archwiki/maintenance/benchmarks
Pierre Schmitz 20d5e251c2 Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
..
data Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
README.md Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
benchmarkCommentFormatter.php Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
benchmarkEval.php Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
benchmarkHooks.php Update to MediaWiki 1.36.1 2021-07-15 08:33:23 +02:00
benchmarkJSMinPlus.php Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
benchmarkLruHash.php Update to MediaWiki 1.36.1 2021-07-15 08:33:23 +02:00
benchmarkParse.php Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
benchmarkPurge.php Update to MediaWiki 1.35.0 2020-11-14 17:26:20 +01:00
benchmarkSanitizer.php Update to MediaWiki 1.36.1 2021-07-15 08:33:23 +02:00
benchmarkTidy.php Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00
benchmarkTitleValue.php Update to MediaWiki 1.37.1 2021-12-19 15:08:59 +01:00

README.md

This directory hold several benchmarking scripts used track performances of MediaWiki and/or PHP.

Consistency

To gain greater precision than the time elapsed as reported by the benchmark itself, one can use the perf_events tool on Linux to count the number of CPU instructions, in addition to measuring how long it took to execute them.

This should accurately tell you how much machine code is executed. Note that this does not correctly model the cost of each instruction (especially memory access).

For example:

$ perf stat -e instructions php -d opcache.enable_cli=1 \
  maintenance/benchmarks/benchmarkEval.php --code="Html::openElement( 'a', [ 'class' => 'foo' ] )" \
  --inner=1000 --count=10000

eval:
   count: 10000
    rate:    590.1/s
   total: 16946.61ms
    mean:     1.69ms
      ...

Performance counter stats for 'php maintenance/benchmarks/..':
    83651088078  instructions
   17.225255198  seconds time elapsed
            ...

Fixtures