Skip to content

Add benchmarking to CI #11068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed

Add benchmarking to CI #11068

wants to merge 11 commits into from

Conversation

iluuu1994
Copy link
Member

@iluuu1994 iluuu1994 commented Apr 13, 2023

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 JIT), and the -T10,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-demo-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 iluuu1994#73). Unfortunately, this requires a dedicated machine to run which would cost $50 monthly upwards on Digital Ocean.

@iluuu1994 iluuu1994 requested a review from TimWolla as a code owner April 13, 2023 12:22
Delay cloning of data repo, abort when there are merge conflicts.
@iluuu1994 iluuu1994 closed this in afbc71d Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants