Profiling and Benchmarks

Benchmarks

CodSpeed runs the benchmarks under benchmarks/ in CI. Run them locally with:

python -m pytest benchmarks/ --codspeed

Add a benchmark for substantial new behavior and investigate reported regressions before merging.

Profiling

Profile a specific benchmark with pytest-profiling, then inspect the generated .prof file with SnakeViz:

pip install snakeviz
pytest benchmarks/test_patch_benchmarks.py::TestProcessingBenchmarks::test_pass_filter --profile
snakeviz prof/test_pass_filter_performance.prof