[php-src] PR #11068: Add benchmarking to CI
| From: | iluuu1994 | Date: | Thu, 13 Apr 2023 12:35:37 +0000 |
| Subject: | [php-src] PR #11068: Add benchmarking to CI | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-22316@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11068
Author: iluuu1994
This PR adds benchmarking to CI. It currently runs Symfony Demo, Wordpress and Zend/bench.php
(adding more is encouraged in the future) using php-cgi, Valgrind, Opcache, and the
-T1,1 flag. This flag makes php-cgi execute a warmup request, caching PHP files in shm
before running the profiled request. We currently only collect executed CPU instructions. Additional
metrics might be useful (e.g. CPU cache misses) but tracking those makes Valgrind factors slower.
The results are then committed to https://github.com/iluuu1994/php-benchmark-data/.
This repository should be moved to the php GitHub org. However, I don't have the permission to
create new repositories, so somebody would have to do it for me
(php/benchmarking-data). Likewise, we've pinned Symfony Demo and Wordpress to
exact sources by committing the full source code (including vendors) to separate repositories
(https://github.com/iluuu1994/symfony-demo-2.2.3, https://github.com/iluuu1994/wordpress-6.2),
(php/benchmarking-symfony-2.2.3 and php/benchmarking-wordpress-6.2, if
somebody does it for me). The main reason for this is that changes in master might
break the benchmarks, but we can't trivially fix those upstream. Even if we did, pulling in
more changes would skew the benchmark, as changes in the libraries may improve or degrade
performance for unrelated reasons.
@nielsdos also made a visualization for the collected data, which will show development of
performance over time, thank you! https://nielsdos.github.io/php-benchmark-visualisation/
I also experimented with libpfm instead of using Valgrind, which would use hardware to
collect metrics and likely be the better solution as we could run benchmarks at real time and
collect more metrics and run more benchmarks (see https://github.com/iluuu1994/php-src/pull/73).
Unfortunately, this requires a dedicated machine to run which would cost $50 monthly upwards on
Digital Ocean.