24 require_once __DIR__ .
'/../includes/Benchmarker.php';
36 private $titleFormatter;
45 private $dbKey =
'FooBar';
61 parent::__construct();
66 $this->titleFormatter = MediaWikiServices::getInstance()->getTitleFormatter();
67 $this->titleParser = MediaWikiServices::getInstance()->getTitleParser();
70 $this->toParse =
'Category:FooBar';
73 'function' => [ $this,
'constructTitleValue' ],
76 'function' => [ $this,
'constructTitle' ],
79 'function' => [ $this,
'constructTitleSafe' ],
82 'function' => [ $this,
'getPrefixedTextTitleValue' ],
85 'function' => [ $this,
'getPrefixedTextTitle' ],
87 'parseTitleValue cached' => [
88 'function' => [ $this,
'parseTitleValue' ],
89 'setup' => [ $this,
'randomize' ],
91 'parseTitle cached' => [
92 'function' => [ $this,
'parseTitle' ],
93 'setup' => [ $this,
'randomize' ],
95 'parseTitleValue no cache' => [
96 'function' => [ $this,
'parseTitleValue' ],
97 'setupEach' => [ $this,
'randomize' ],
99 'parseTitle no cache' => [
100 'function' => [ $this,
'parseTitle' ],
101 'setupEach' => [ $this,
'randomize' ],
118 return Title::makeTitle(
NS_CATEGORY, $this->dbKey );
122 return Title::makeTitleSafe(
NS_CATEGORY, $this->dbKey );
127 return $this->titleFormatter->getPrefixedText( $this->titleValue );
131 return $this->title->getPrefixedText();
136 $this->titleParser->parseTitle(
'Category:' . $this->dbKey,
NS_MAIN );
140 Title::newFromText(
'Category:' . $this->dbKey );
145 require_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.
addDescription( $text)
Set the description text.
Represents a page (or page fragment) title within MediaWiki.