Skip to content
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

bpo-43760: Check for tracing using 'bitwise or' instead of branch in dispatch. #28723

Merged
merged 4 commits into from
Oct 5, 2021

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Oct 4, 2021

About 1% faster

Use bitwise or instead of additional jump to handle tracing in dispatch.

What was:

    if (use_tracing)
        goto tracing_dispatch
    goto *jump_table[opcode];

becomes:

     goto *jump_table[opcode | use_tracing];

use_tracing is now either 0 or 255

Special opcode 255 (DO_TRACING) handles tracing and then jumps to the original instruction.

The main complexity comes from needing access to the last instruction when tracing. This means that we update frame->f_lasti and next_instr at the start of the instruction, instead of at the end of the previous instruction.

https://bugs.python.org/issue43760

@markshannon markshannon added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 4, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @markshannon for commit a9ff904 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 4, 2021
@markshannon
Copy link
Member Author

Buildbot failures seem unrelated: A network error and too many open files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants