Companion assets for running pyperformance benchmarks on hosts that provide isolated CPUs and for backfilling historical CPython revisions to speed.python.org.
run-pyperformance.sh– shell wrapper that reserves an isolated CPU (175–191) via lockfiles, rendersbenchmark.conffrombenchmark.conf.inwithm4, sets up a virtual environment, and runspyperformancewith upload enabled.benchmark.conf.in– template consumed by the wrapper; placeholdersTMPDIRandCPUIDare filled in so each run has its own working tree, build directory, and CPU affinity.backfill.py– Python helper that reads revisions frombackfill_shas.txtand launches multiplerun-pyperformance.shjobs in parallel, capturing stdout/stderr per revision underoutput/.backfill_shas.txt– example list ofsha=branchpairs targeted by the backfill script.
- Ensure kernel CPU isolation (
isolcpus=175-191) and thelockfileutility are available so the wrapper can pin workloads without contention. - Invoke
./run-pyperformance.sh -- compile benchmark.conf <sha> <branch>for an ad-hoc run; the script installspyperformance==1.13.0, clones CPython, and uploads results using the environment label configured inbenchmark.conf.in. - Populate
backfill_shas.txtwith the revisions you want to replay and runpython backfill.pyto batch process them; individual logs land inoutput/<branch>-<sha>.out|.err.
Adjust benchmark.conf.in if you need to change build parameters (PGO/LTO, job count, upload target, etc.).
If you want a daily unattended run, drop an entry like this into crontab -e on the host:
0 0 * * * cd /home/user/pyperformance/examples/benchmarking-scripts && ./run-pyperformance.sh -- compile_all benchmark.conf > /home/pyperf/pyperformance/cron.log 2>&1