Repository navigation
Conversation
Collaborator
|
I believe this optimization is equivalent to the original code, but the performance gain seems too small to justify the significant impact on readability. |
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.
Keep the existing #271 trace slot,
(pc >> 2) & 8191, and simplify only the x86-64 calculation of its byte offset. With a 296-byteTrace, the following are identical for every PC, including odd and high addresses:Use the generated stride divided by four, with an assembly-time guard against a future incompatible stride. Both dispatch lookups and the sequential prefetch now compile to
and $0x7ffc, %eax; imul $0x4a, %eax, %eax, removing the shift from that dependency chain. No change to the Rust fill path, tag comparison (including the legacyLOAD_PCbehavior), table initialization, collisions, charging or prefetch policy. Based directly onrelease-0.24, independent of other trace PRs.Validation
make test-asm(168 passed),make test(83 passed) on Linux x86-64. Also assembled the file for Darwin x86-64 and Windows x64 (not runtime-tested there).7c15aac: identical cycle-limit outcomes at N-1, N and N+1 for 70 mainnet transactions with externally supplied N.TransactionScriptsVerifier::verifytime was −0.22% vs the branch parent (round-bootstrap 95% interval −0.51% to +0.01%; parent A/A +0.18%). An earlier fixed-layout v0.24.15 harness comparison on the same corpus measured −1.05%. The instruction reduction is deterministic; the exact source-build timing does not establish a reliable node-level speedup.