wiki.techinc.nl/maintenance/benchmarks
Umherirrender 06947613d7 maintenance: Use namespaced classes
This does not include use of MediaWiki\Maintenance\Maintenance,
assuming the maintenance scripts going into the same namespace

Change-Id: I488f95b537ce86eb5e463be7bce3653610dd13d9
2024-10-21 19:08:08 +02:00
..
data Add benchmark for Linker::formatComment() in preparation for refactor 2021-08-24 13:57:53 +10:00
benchmarkCommentFormatter.php Exclude boilerplate maintenance code from code coverage reports 2024-08-27 13:22:29 +01:00
benchmarkEval.php Exclude boilerplate maintenance code from code coverage reports 2024-08-27 13:22:29 +01:00
benchmarkHooks.php maintenance: Add missing documentation to class properties 2024-09-13 19:29:24 +02:00
benchmarkJsonCodec.php maintenance: Add missing documentation to class properties 2024-09-13 19:29:24 +02:00
benchmarkJsValidate.php maintenance: Add missing documentation to class properties 2024-09-13 19:29:24 +02:00
benchmarkLruHash.php maintenance: Use namespaced classes 2024-10-21 19:08:08 +02:00
benchmarkParse.php maintenance: Use more of namespaced Maintenance class 2024-10-16 01:09:19 +00:00
benchmarkPurge.php Exclude boilerplate maintenance code from code coverage reports 2024-08-27 13:22:29 +01:00
benchmarkSanitizer.php Exclude boilerplate maintenance code from code coverage reports 2024-08-27 13:22:29 +01:00
benchmarkSettings.php Exclude boilerplate maintenance code from code coverage reports 2024-08-27 13:22:29 +01:00
benchmarkTidy.php Exclude boilerplate maintenance code from code coverage reports 2024-08-27 13:22:29 +01:00
benchmarkTitleValue.php Exclude boilerplate maintenance code from code coverage reports 2024-08-27 13:22:29 +01:00
benchmarkTruncate.php Pass function name to IDatabase functions 2024-09-19 21:02:52 +02:00
README.md benchmarks: Remove old bench, document perf -e instructions 2021-08-26 05:53:49 +00:00

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