Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
[u64; 4]
from small version to move Arc
to full version
Cloning and dropping the version arc took a significant fraction of the time in the resolver, which is a large overhead especially for the small variant that has only 9 bytes payload. When moving the `Arc` to only apply to the full variant, the small variant is too large because it stores a `[u64; 4]` to have a release accessor a `&[u64]` that's shared with the `Vec<u64>` of the full variant. We proxy this by first extracting the compressed version digits of the small variant to a proxy type that stores up to 4 u64 on the stack and can be deref'ed to the existing `&[u64]`, minimizing churn. ``` $ Benchmark 1: target/profiling/uv pip compile scripts/requirements/airflow.in Time (mean ± σ): 361.3 ms ± 2.7 ms [User: 503.4 ms, System: 174.9 ms] Range (min … max): 356.3 ms … 365.2 ms 10 runs Benchmark 2: ./uv-3 pip compile scripts/requirements/airflow.in Time (mean ± σ): 402.9 ms ± 8.5 ms [User: 571.2 ms, System: 196.6 ms] Range (min … max): 393.9 ms … 418.0 ms 10 runs Summary target/profiling/uv pip compile scripts/requirements/airflow.in ran 1.12 ± 0.03 times faster than ./uv-3 pip compile scripts/requirements/airflow.in ```
- Loading branch information