Avatar for the astral-sh user
astral-sh
uv
Instrumentation
Wall Time
BlogDocsChangelog

Make `uv cache clean` parallel process safe

#15888
Comparing
konsti/safe-cache-clean
(
a9df4a5
) with
main
(
fb71b07
)
CodSpeed Performance Gauge
+3%
Untouched
3

Benchmarks

Passed

resolve_warm_jupyter
crates/uv-bench/benches/uv.rs::uv::resolve_warm_jupyter::resolve_warm_jupyter
CodSpeed Performance Gauge
+7%
72.1 ms67.6 ms
resolve_warm_jupyter_universal
crates/uv-bench/benches/uv.rs::uv::resolve_warm_jupyter_universal::resolve_warm_jupyter_universal
CodSpeed Performance Gauge
+1%
200.1 ms197.2 ms
resolve_warm_airflow
crates/uv-bench/benches/uv.rs::uv::resolve_warm_airflow::resolve_warm_airflow
CodSpeed Performance Gauge
0%
739.6 ms739.8 ms

Commits

Click on a commit to change the comparison range
Base
main
fb71b07
+2.69%
Make `uv cache clean` concurrency safe Currently, `uv cache clean` and `uv cache prune` can cause crashes in other uv processes running in parallel by removing their in-use files. We can solve this by using a shared (read) lock on the cache directory, while the `uv cache` operations use an exclusive (write) lock. The drawback is that this is always one extra lock, and that we assume that all platforms support shared locks. Once Rust 1.89 fulfills our N-2 policy, we can add support for these methods in fs_err and switch to https://doc.rust-lang.org/std/fs/struct.File.html#platform-specific-behavior-2.
a9df4a5
5 hours ago
by konstin
© 2025 CodSpeed Technology
Home Terms Privacy Docs