Manual:benchmarkParse.php
MediaWiki version: | ≥ 1.23 |
MediaWiki file: benchmarkParse.php | |
---|---|
Location: | maintenance/benchmarks/ |
Source code: | master • 1.42.4 • 1.41.5 • 1.39.11 |
Classes: | BenchmarkParse |
Details
editbenchmarkParse.php file is a maintenance script to benchmark how long it takes to parse a given title at an optionally specified timestamp.
Options/Arguments
editOption/Argument | Description | Required? |
---|---|---|
title | The name of the page to parse | Required |
--warmup | Repeat the parse operation this number of times to warm the cache | Optional |
--loops | Number of times to repeat parse operation post-warmup | Optional |
--page-time | Use the version of the page which was current at the given time | Optional |
--tpl-time | Use templates which were current at the given time (except that moves and deletes are not handled properly) | Optional |
--reset-linkcache | Reset the LinkCache after every parse. | Optional |
Usage
editphp maintenance/run.php benchmarks/benchmarkParse title [ --warmup| --loops| --page-time| --tpl-time| --reset-linkcache ]
Terminal
$ php maintenance/run.php benchmarks/benchmarkParse "Main Page" CPU time = 0.003 s, wall clock time = 0.006 s
In MediaWiki version 1.39.10 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.Obama test
editColloquial name for a quick test of the parsing speed on Wikimedia servers, which uses the infamous Barack Obama article (which used to take 30+ seconds for parsing).
php /usr/local/apache/common/multiversion/MWScript.php maintenance/benchmarks/benchmarkParse.php \
--wiki=enwiki --loops=10 --warmup=10 "Barack Obama"