wiki.techinc.nl/maintenance/benchmarks
2024-01-20 17:22:48 +00:00
..
data Add benchmark for Linker::formatComment() in preparation for refactor 2021-08-24 13:57:53 +10:00
benchmarkCommentFormatter.php Replace deprecated Linker::formatComment in benchmarkCommentFormatter 2023-10-13 09:44:34 +00:00
benchmarkEval.php build: Cleanup of .phpcs.xml 2023-04-13 12:57:51 +02:00
benchmarkHooks.php Update benchmarkHooks.php to use HookContainer 2023-05-18 16:39:33 +10:00
benchmarkJsonCodec.php benchmarks: Add benchmark for JsonCodec 2022-10-11 10:41:13 +00:00
benchmarkJsValidate.php ResourceLoader: Remove libs/jsminplus.php (JSMinPlus, JSParser) 2024-01-19 05:07:23 +00:00
benchmarkLruHash.php phan: Disable null_casts_as_any_type setting 2022-03-21 18:25:07 +00:00
benchmarkParse.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
benchmarkPurge.php Namespace remaining files under includes/deferred 2023-11-22 10:08:53 -05:00
benchmarkSanitizer.php Namespace Sanitizer under \MediaWiki\Parser 2023-09-21 05:39:23 +00:00
benchmarkSettings.php Remove support for MW_USE_LEGACY_DEFAULT_SETTINGS 2023-03-02 13:39:17 +00:00
benchmarkTidy.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
benchmarkTitleValue.php Namespace TitleParser under \MediaWiki\Title 2023-09-19 05:19:00 +00:00
benchmarkTruncate.php Replace use of "unquoted" with "raw" for tableName() callers 2023-11-21 10:43:10 -08: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