perf: micro-optimize resolver normal path#215
Draft
hardfist wants to merge 5 commits into
Draft
Conversation
Merging this PR will improve performance by 9.94%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | resolver[[single-threaded]resolve with many extensions] |
147.2 ms | 141.4 ms | +4.08% |
| ⚡ | Simulation | resolver[multi-thread] |
65.1 ms | 61.5 ms | +5.91% |
| ⚡ | Simulation | resolver[resolve from symlinks] |
195.6 ms | 172.2 ms | +13.58% |
| ⚡ | Simulation | resolver[single-thread] |
56.9 ms | 54 ms | +5.43% |
| ⚡ | Simulation | resolver[resolve from symlinks multi thread] |
123.7 ms | 101.7 ms | +21.67% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing perf/micro-optimize-resolver (91e539f) with main (8975e38)
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.
Goal
Micro-optimize the resolver normal path by at least 5% using exact Callgrind instruction references as the primary metric.
Benchmark
Target benchmark:
Metric: Callgrind
Irfrom CodSpeed Valgrind.Baseline:
116,917,041Ir.5% target threshold:
111,071,189Ir.Final:
109,733,110Ir (-7,183,931,-6.15%).Changes and Measurements
05be16b116,554,214-362,827(-0.31%)cargo test --lib -- --skip tests::pnp16c1795114,956,513-1,960,528(-1.68%)cargo test --lib -- --skip tests::pnp278d640112,025,825-4,891,216(-4.18%)cargo test --lib -- --skip tests::pnpe6517c6109,733,110-7,183,931(-6.15%)cargo test --lib -- --skip tests::pnpArtifacts
optimization-artifacts/valgrind/callgrind/20260517T043326Z-single-thread-baseline/optimization-artifacts/valgrind/callgrind/20260517T043726Z-single-thread-unix-extension-buffer/optimization-artifacts/valgrind/callgrind/20260517T044703Z-single-thread-absolute-alias-filter/optimization-artifacts/valgrind/callgrind/20260517T045216Z-single-thread-partition-aliases/optimization-artifacts/valgrind/callgrind/20260517T045641Z-single-thread-path-alias-precheck/optimization-artifacts/valgrind/callgrind/20260517T045822Z-single-thread-final/Test Status
cargo test --lib -- --skip tests::pnppasses (123 passed).A full
cargo test --libstill fails the existing PnP fixture cases (125 passed; 6 failed) withNotFoundfixture paths. Those failures were observed before these perf changes and are tracked here as a residual environment/fixture gap, not as a new regression from this branch.Status
Target achieved for exact
resolver[single-thread]:109,733,110Ir is6.15%below the clean baseline.