User "Platonides" posted a comment on MediaWiki.r89230.
Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89230#c17571
Commit summary:
The big regex at doMagicLinks deserves being more thoroughly studied.
Comment:
Thanks Hashar. As I first wanted to prove that studied regex were faster than
normal ones what I did was to measure the time needed to process
eswiki-20110318-pages-meta-current (3236515 revisions).
However, I got the opposite result: the studied regexes turned out to be
slightly slower.
I was looking today on running pcre with just a light layer of php_pcre to look
for the reason, but it's not ready yet.
<source lang="php">
class BenchmarkMagicLinks extends DumpIterator {
public function __construct() {
parent::__construct();
$this->mDescription = "Run doMagicLinks on a XML dump";
}
public function checkOptions() {
$this->mParser = new Parser();
$this->mParser->startExternalParse(
Title::newFromText("BenchmarkMagicLinks") , new ParserOptions, Parser::OT_HTML,
true );
}
public function getDbType() {
return Maintenance::DB_NONE;
}
public function processRevision( $rev ) {
$this->mParser->doMagicLinks( $rev->getText() );
}
}
$maintClass = "BenchmarkMagicLinks";
require( RUN_MAINTENANCE_IF_MAIN );
</source>
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview