wiki.techinc.nl/maintenance/benchmarks
Roman Stolar fa5237eb48 Replace Content::getParserOutput call to ContentRenderer::getParserOutput
Bug: T287158
Change-Id: I8a13f45027e08e2d8ddefa140dd47a0c55094934
2021-10-20 12:11:24 +03:00
..
data Add benchmark for Linker::formatComment() in preparation for refactor 2021-08-24 13:57:53 +10:00
benchmarkCommentFormatter.php Introduce CommentFormatter 2021-09-28 11:13:03 -07:00
benchmarkEval.php benchmarks: Add benchmarkEval.php, for one-off benchmarks 2021-08-23 19:54:20 +00:00
benchmarkHooks.php Use static closures where safe to use 2021-02-11 00:13:52 +00:00
benchmarkJSMinPlus.php benchmarks: Set a default file in benchmarkJSMinPlus.php 2021-08-26 04:40:02 +01:00
benchmarkLruHash.php objectcache: Avoid getCurrentTime() call in MapCacheLRU::has() 2021-09-10 02:18:00 +00:00
benchmarkParse.php Replace Content::getParserOutput call to ContentRenderer::getParserOutput 2021-10-20 12:11:24 +03:00
benchmarkPurge.php benchmarks: Exclude from PHPUnit test coverage 2019-12-18 01:24:42 +00:00
benchmarkSanitizer.php maintenance: Mark some closures as static 2021-02-07 02:18:30 +00:00
benchmarkTidy.php Add benchmark for Linker::formatComment() in preparation for refactor 2021-08-24 13:57:53 +10:00
benchmarkTitleValue.php Update Legoktm's email address 2021-05-02 05:39:37 +00: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