perf: restore typed load performance - #187
Merged
Merged
Conversation
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
serde_json::Valuetree and converting it withfrom_value.nodesincrementally so diagnostics from valid entries survive later typed decode failures.report/mod.rs,report/decode.rs, andreport/tests.rs.Problem
The 0.2.5 release candidate introduced a full generic JSON tree before typed manifest decoding. On manifests with thousands of nodes, commands that require the typed manifest paid a node-linear regression even when the requested lineage was tiny. A reported 4,400-node production manifest added about 52 ms to
column upstreamandcheck-manifest; synthetic manifests showed the gap growing to about 80 ms at 16,000 nodes on macOS.Design
The decoder now assigns known top-level fields directly into
Manifest. Only values required for compatibility reporting remain generic JSON: metadata, untyped resource maps, and unknown top-level fields. A compile-time exhaustiveManifestpattern requires the visitor to be reviewed whenever a field is added.nodesuse an incremental typed visitor. Each successfully decoded node is classified once and any unsupported-resource observation is retained immediately. This keeps diagnostics available if a later node or top-level field is malformed, without another pass or a per-nodeValueround trip.Known duplicate top-level fields remain errors, matching the stable 0.2.4 typed loader. Duplicate IDs inside the
nodesmap retainHashMap's last-value-wins behavior.Performance
Linux x86_64, dist profile, Hyperfine 1.19.0, 3 warmups and 10 measured runs. The comparison uses the verified GitHub Release binary for 0.2.4, the 0.2.5 release-candidate baseline, and this branch.
check-manifest -qexercises the typed loader in a real dbt project layout:The 0.2.5 RC overhead of 53.5/222.3/435.0 ms is reduced to 1.8/9.6/4.4 ms relative to 0.2.4.
summary --no-cacheis also faster than both baselines in this environment.column upstream m5 --no-cacheimproves from 81.8/344.7/742.4 ms median in the RC to 39.5/94.4/201.6 ms. The remaining difference from 0.2.4 is not present incheck-manifest, separating it from the typed-loader regression.Compatibility
Tests cover:
Verification
cargo fmt --all -- --checkcargo test --workspace --locked(955 passed, 10 ignored; plus 94 CLI integration and 9 column-lineage tests)cargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo build --profile dist --locked