-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD #32115
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
Stats before:
After:
|
If I understand the numbers correctly:
Is that correct? |
My reading is that currently there are 584K jumps, of which 114K (~20%) have extended args. Once we convert all absolute jumps, the 380K which have small delta will not have extended args, so there will be about 3K that do. Plus the 9K of relative jumps with extended args gives 12K which is about 2%. Does that sound right? |
Ah, I'm looking at the stats post this PR. You were probably looking at the pre-PR set. |
I agree with your figure of 12k jumps that will need extended arg, both before and after stats give that number. I was quite happy with 5%, 2% is excellent. |
Misc/NEWS.d/next/Core and Builtins/2022-03-25-21-51-10.bpo-47120.9YJ-Xw.rst
Show resolved
Hide resolved
@markshannon This is now merged with main and the tests ran. Did you want to review it again or shall I merge? |
I see that you've dropped the quickening on backward edges. Was this deliberate? It should be OK, provided we switch to early quickening discussed in faster-cpython/ideas#338 (comment). We will need to track this to make sure we don't lose the ability to quicken code in loops. Other than that, LGTM. |
Let me put that back, I don't know why I removed it. Is it ok that other opcodes have PREDICT(JUMP_ABSOLUTE) rather than PREDICT(JUMP_ABSOLUTE_QUICK)? Should I change it to PREDICT(JUMP_BACKWARD_QUICK) rather than PREDICT(JUMP_BACKWARD)? |
It should be OK to remove the quickening, provided that we implement faster-cpython/ideas#338 (comment). In fact it might be better to do so, as it avoids have to quicken all the other back jumps. @brandtbucher would it make it easier to remove the quickening of back jumps now? |
Let's leave the backedge quickening on, since we figured out the issue and we're still not 100% settled on the approach to take for faster-cpython/ideas#338. (This also seems more relevant to a "quicken everything" decision than the "quicken in-place" one, though there is some overlap between the two.) |
We might also want to consider adding a |
@markshannon @brandtbucher I'll let you decide in which order to merge PRs impacting compile.c/ceval.c because you have other PRs on the go. I'll merge as necessary. |
This is the oldest, so I'm merging this first. |
https://bugs.python.org/issue47120