help wantedperformance
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_jupyterandresolve_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.tomlchanged due to a version upgrade, withuv lock --upgrade-packageor when usinguv run --with. Our goal is to resolve versions that preserve most of the existing lockfile. - We run
uv lockand the lockfile matches: We only need to check againstpackage.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.