Repository navigation
Benchmark build dependency settings deserialization - #22849
Merged
Merged
Conversation
Merging this PR will not alter performance1 warning
Performance Changes
Comparing Footnotes
|
Member
Author
|
Note: resolve_activated_extras_independent_pairs[2] appears to be another noisy benchmark. |
woodruffw
force-pushed
the
codex/bench-build-dependency-settings
branch
from
October 23, 2026 16:26
738cb72 to
f6821a8
Compare
charliermarsh
approved these changes
Oct 23, 2026
woodruffw
added a commit
that referenced
this pull request
Oct 23, 2026
Stacked on #22848. The benchmark fixture lives in #22849. Add `DeserializeUntagged` to `uv-macros` and use it for `BuildConstraintDependency` and `ExtraBuildDependencyWire`. The derive dispatches on the input's Serde type and passes the value directly to the selected variant's deserializer. Each variant must accept a distinct input shape. Invalid fields and reader errors come from the selected deserializer. On the build-settings TOML fixture, local medians across 12 interleaved runs on arm64 macOS were 20.70 µs for Serde's untagged derive, 17.88 µs for the handwritten visitors, and 18.12 µs for the macro. These are optimized development builds. The diff against #22848 keeps the benchmark fixture and the five deserialization regression tests intact. All 25 macro and workspace tests and both derive doctests passed on this branch. ### Other uses Seven existing visitors can use the same derive. `CoreMetadata`, `Yanked`, and `ExcludeDependency` were handwritten in #22429. Other direct fits are `GitPattern`, `PreviewFeaturesOption`, `ConfigSettingValue`, and `SourcesWire`. A local trial migration of all seven produced identical values and error messages, including error positions, on 28 valid and 28 invalid JSON inputs. With just `CoreMetadata` and `Yanked` switched over, a stripped arm64 macOS release executable that parses `PypiSimpleDetail` grew by 16 bytes. On the 4,096-file Simple API fixture, median time per parse across 16 alternating pairs was 1.348 ms with handwritten visitors and 1.359 ms with the derive. `CacheKey` still needs its table visitor to distinguish `file`, `dir`, `git`, and `env`. The map arm of `Override<T>` also needs its ordered fallback because both a scoped override and a requirement can deserialize from a map.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Benchmark the cost of parsing
uv.tomlbuild dependency settings intouv_settings::Options. The in-memory fixture contains 16 build constraints and 16 extra build dependencies. Half of each are requirement strings. The other half are tables withhashesormatch-runtime.Run the case in both CodSpeed simulation and walltime to establish a baseline for #22848.
Test plan
cargo test --locked -p uv-bench --bench uv_settings -- parse_build_dependency_settings --testcargo fmt --all --check