bpo-43760: Streamline dispatch sequence for machines without computed gotos. by markshannon · Pull Request #25244 · python/cpython
-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Conversation
-
Do fetch and decode at end of opocde then jump directly to switch.
Should allow compilers that don't support computed-gotos, specifically MSVC,
to generate better code. -
Cleans up the code
This should have no effect when computed gotos are used.
Skipping NEWS, as this shouldn't have any noticeable effect. I'll add a NEWS item to the other PR for https://bugs.python.org/issue43760 as that should have a (just?) measurable effect.
* Do fetch and decode at end of opocde then jump directly to switch. Should allow compilers that don't support computed-gotos, specifically MSVC, to generate better code.
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 82d2cd0 🤖
If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.
Thanks for doing this. It looks like a nice improvement.
Why did you switch to uint8_t? That doesn't seem consistent with the rest of the code.
@rhettinger
The primary reason for the change to uint8_t will be in later PR. If we add cases for all unknown opcodes then the compiler will know that the cases are exhaustive and won't need to emit bounds checks when dispatching.
I'll revert it to int for now.