This document describes the compatibility fixes implemented to allow benchmarking across different dulwich versions.
- Issue: Older versions fail when parent directory doesn't exist
- Fix: Added
os.makedirs(self.repo_path, exist_ok=True)beforeRepo.init()
- Issue:
repo.stage()method doesn't exist in older versions - Fix: Fall back to manual index manipulation using
index_entry_from_stat()
- Issue: API changed from
parentstoparent_commitsparameter - Fix: Try
parent_commitsfirst, fall back to setting HEAD and using no parent parameter
- Issue: ASV passes parameters to teardown but base class didn't accept them
- Fix: Changed
teardown(self)toteardown(self, *args)
The benchmarks have been tested and work with:
- dulwich 0.20.x and later (fully tested)
- dulwich 0.18.x - 0.19.x (should work with current fixes)
- dulwich 0.15.x - 0.17.x (may work, untested)
- dulwich < 0.15.x (may have build issues with Python 3.13)
To run benchmarks on historical releases:
# Single release
asv run --quick dulwich-0.20.0^!
# Range of releases
asv run --quick dulwich-0.20.0..dulwich-0.23.0
# Generate report
asv publish
asv preview- Very old dulwich versions (< 0.15.0) may not build with Python 3.13 due to C extension incompatibilities
- Some benchmarks may need additional fixes for versions older than 0.18.0
- Performance comparisons across major API changes should be interpreted carefully