-
Notifications
You must be signed in to change notification settings - Fork 14k
Perf: Optimize target_for_value lookup
#149186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
r? @chenyukang rustbot has assigned @chenyukang. Use |
|
Is that code path particularly hot in your experience? It doesn't hurt to check, even if it may be unlikely (and the reason why "no one noticed"). @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Perf: Optimize `target_for_value` lookup
This comment has been minimized.
This comment has been minimized.
Idk, was just reading some part of the codebase and picked it out |
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (6014c74): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (primary -2.0%, secondary 3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%, secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 473.456s -> 472.515s (-0.20%) |
Replaced the
iter().zip().find_map()chain with a slice basediter().position()scan.The zip iterator forced a runtime
cmp/cmovbcheck betweenvalues.len()andtargets.len()to establish loop bounds. The new implementation depends solely on values, decoupling the dependency chain.https://godbolt.org/z/hGda7PYzz