mirror of
https://github.com/astral-sh/uv
synced 2026-01-22 22:10:11 -05:00
## Summary This PR consolidates the concurrency limits used throughout `uv` and exposes two limits, `UV_CONCURRENT_DOWNLOADS` and `UV_CONCURRENT_BUILDS`, as environment variables. Currently, `uv` has a number of concurrent streams that it buffers using relatively arbitrary limits for backpressure. However, many of these limits are conflated. We run a relatively small number of tasks overall and should start most things as soon as possible. What we really want to limit are three separate operations: - File I/O. This is managed by tokio's blocking pool and we should not really have to worry about it. - Network I/O. - Python build processes. Because the current limits span a broad range of tasks, it's possible that a limit meant for network I/O is occupied by tasks performing builds, reading from the file system, or even waiting on a `OnceMap`. We also don't limit build processes that end up being required to perform a download. While this may not pose a performance problem because our limits are relatively high, it does mean that the limits do not do what we want, making it tricky to expose them to users (https://github.com/astral-sh/uv/issues/1205, https://github.com/astral-sh/uv/issues/3311). After this change, the limits on network I/O and build processes are centralized and managed by semaphores. All other tasks are unbuffered (note that these tasks are still bounded, so backpressure should not be a problem).
52 lines
1.3 KiB
TOML
52 lines
1.3 KiB
TOML
[package]
|
|
name = "bench"
|
|
version = "0.0.0"
|
|
description = "uv Micro-benchmarks"
|
|
publish = false
|
|
authors = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
homepage = { workspace = true }
|
|
documentation = { workspace = true }
|
|
repository = { workspace = true }
|
|
license = { workspace = true }
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
bench = false
|
|
|
|
[[bench]]
|
|
name = "distribution-filename"
|
|
path = "benches/distribution_filename.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "uv"
|
|
path = "benches/uv.rs"
|
|
harness = false
|
|
|
|
[dependencies]
|
|
distribution-filename = { workspace = true }
|
|
distribution-types = { workspace = true }
|
|
criterion = { version = "0.5.1", default-features = false, features = ["async_tokio"] }
|
|
tokio = { workspace = true }
|
|
codspeed-criterion-compat = { version = "2.6.0", default-features = false, optional = true }
|
|
tempfile = { workspace = true }
|
|
fs-err = { workspace = true }
|
|
uv-resolver = { workspace = true }
|
|
uv-cache = { workspace = true }
|
|
uv-client = { workspace = true }
|
|
uv-configuration = { workspace = true }
|
|
uv-distribution = { workspace = true }
|
|
uv-types = { workspace = true }
|
|
uv-interpreter = { workspace = true }
|
|
platform-tags = { workspace = true }
|
|
pep508_rs = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
once_cell = { workspace = true }
|
|
|
|
[features]
|
|
codspeed = ["codspeed-criterion-compat"]
|