28require_once __DIR__ .
'/../includes/Benchmarker.php';
41 private $titleFormatter;
50 private $dbKey =
'FooBar';
66 parent::__construct();
75 $this->toParse =
'Category:FooBar';
78 'function' => [ $this,
'constructTitleValue' ],
81 'function' => [ $this,
'constructTitle' ],
84 'function' => [ $this,
'constructTitleSafe' ],
87 'function' => [ $this,
'getPrefixedTextTitleValue' ],
90 'function' => [ $this,
'getPrefixedTextTitle' ],
92 'parseTitleValue cached' => [
93 'function' => [ $this,
'parseTitleValue' ],
94 'setup' => [ $this,
'randomize' ],
96 'parseTitle cached' => [
97 'function' => [ $this,
'parseTitle' ],
98 'setup' => [ $this,
'randomize' ],
100 'parseTitleValue no cache' => [
101 'function' => [ $this,
'parseTitleValue' ],
102 'setupEach' => [ $this,
'randomize' ],
104 'parseTitle no cache' => [
105 'function' => [ $this,
'parseTitle' ],
106 'setupEach' => [ $this,
'randomize' ],
123 return Title::makeTitle(
NS_CATEGORY, $this->dbKey );
127 return Title::makeTitleSafe(
NS_CATEGORY, $this->dbKey );
132 return $this->titleFormatter->getPrefixedText( $this->titleValue );
136 return $this->title->getPrefixedText();
141 $this->titleParser->parseTitle(
'Category:' . $this->dbKey,
NS_MAIN );
145 Title::newFromText(
'Category:' . $this->dbKey );
151require_once RUN_MAINTENANCE_IF_MAIN;
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.
Maintenance script that benchmarks TitleValue vs Title.
getPrefixedTextTitleValue()
randomize()
Use a different dbKey each time to avoid influence of Title caches.
__construct()
Default constructor.
execute()
Do the actual work.
Base class for benchmark scripts.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.