-
Notifications
You must be signed in to change notification settings - Fork 21.6k
core/vm: hoist jumptable nil-check out of the interpreter loop #32068
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
core/vm: hoist jumptable nil-check out of the interpreter loop #32068
Conversation
2140d2f to
301d5a8
Compare
| stack = newstack() // local stack | ||
| callContext = &ScopeContext{ | ||
| op OpCode // current opcode | ||
| jumpTable *JumpTable = in.table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why it's a pointer at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess to avoid 2KB copies on each interpreter creation.
|
Please post benchstat comparison. |
"op" here is a 100 gas worth of execution. |
|
apparently there is an already existing VM benchmark in the repo. Will remove the one added here. |
MariusVanDerWijden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM, pretty crazy that this has such a big impact in the benchmarks
|
Deployed on 07/08 for a sanity check |
Moves the jumptable nil check our of the interpreter loop. Benchmarks show a 2-10% improvement.
Moves the jumptable nil check our of the interpreter loop. Benchmarks show a 2-10% improvement.


simple enough. benchmark of a dummy EVM loop shows ~%2 speed up on my machine.