astral-sh/uv

Add incremental resolution benchmark to codspeed

Open

#6,418 opened on Aug 22, 2024

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Rust (3,111 forks)batch import
help wantedperformance

Repository metrics

Stars
 (84,934 stars)
PR merge metrics
 (Avg merge 7d 16h) (259 merged PRs in 30d)

Description

There are three scenarios for the uv resolver:

  • Fresh resolution: We have a set of requirements, but no lockfile. We need to figure a resolution without any prior context. These are continuously tested by resolve_warm_airflow, resolve_warm_jupyter and resolve_warm_jupyter_universal.
  • Incremental resolution: We have a lockfile that gives us preferences for versions (and help prefetching), but it's incompatible or incomplete with the requirements. This happens in a lot of cases, e.g. when pyproject.toml changed due to a version upgrade, with uv lock --upgrade-package or when using uv run --with. Our goal is to resolve versions that preserve most of the existing lockfile.
  • We run uv lock and the lockfile matches: We only need to check against package.metadata.requires-dist.

While we have good coverage for the first case and the last case is fast beyond the need for optimization (<20ms even for transformers with all extras), we don't have good coverage for the middle case. We should add a scenario to codspeed, with a universal resolution where the requirements changes so that they don't match uv.lock anymore.

Contributor guide