uv
65efee1d - Add compare_release fast path (#799)

Commit
2 years ago
Add compare_release fast path (#799) Looking at the profile for tf-models-nightly after #789, `compare_release` is the single biggest item. Adding a fast path, we avoid paying the cost for padding releases with 0s when they are the same length, resulting in a 16% for this pathological case. Note that this mainly happens because tf-models-nightly is almost all large dev releases that hit the slow path. **Before** ![image](https://github.com/astral-sh/puffin/assets/6826232/0d2b4553-da69-4cdb-966b-0894a6dd5d94) **After** ![image](https://github.com/astral-sh/puffin/assets/6826232/6d484808-9d16-408d-823e-a12d321802a5) ``` $ hyperfine --warmup 1 --runs 3 "target/profiling/main pip-compile -q scripts/requirements/tf-models-nightly.txt" "target/profiling/puffin pip-compile -q scripts/requirements/tf-models-nightly.txt" Benchmark 1: target/profiling/main pip-compile -q scripts/requirements/tf-models-nightly.txt Time (mean ± σ): 11.963 s ± 0.225 s [User: 11.478 s, System: 0.451 s] Range (min … max): 11.747 s … 12.196 s 3 runs Benchmark 2: target/profiling/puffin pip-compile -q scripts/requirements/tf-models-nightly.txt Time (mean ± σ): 10.317 s ± 0.720 s [User: 9.885 s, System: 0.404 s] Range (min … max): 9.501 s … 10.860 s 3 runs Summary target/profiling/puffin pip-compile -q scripts/requirements/tf-models-nightly.txt ran 1.16 ± 0.08 times faster than target/profiling/main pip-compile -q scripts/requirements/tf-models-nightly.txt ```
Author
Parents
Loading