-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-44525: Specialize CALL_FUNCTION
for C function calls
#26934
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
Merged
markshannon
merged 55 commits into
python:main
from
Fidget-Spinner:call_function_specialize
Oct 19, 2021
Merged
Changes from 7 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
5e73b74
WIP: Specialize CALL_FUNCTION for builtins
Fidget-Spinner 1539105
fix some GCC compilation warnings
Fidget-Spinner 68e5451
hopefully fix the segfaults
Fidget-Spinner 1d841b0
Rename to CALL_CFUNCTION and generalize to all c functions
Fidget-Spinner f41b623
fix formatting, remove redundant check
Fidget-Spinner de520bd
goto fail rather than return -1
Fidget-Spinner 0e0a3a4
Create 2021-06-28-22-23-59.bpo-44525.sSvUKG.rst
Fidget-Spinner 65de42d
Apply easier suggestions from Mark's review
Fidget-Spinner 685557f
Only specialize METH_FASTCALL and METH_O
Fidget-Spinner 5baa936
Update 2021-06-28-22-23-59.bpo-44525.sSvUKG.rst
Fidget-Spinner bc69360
turn off specialization stats flag
Fidget-Spinner 8671a60
Apply suggestions by Mark
Fidget-Spinner a8b8b4f
reduce diff
Fidget-Spinner 736d9af
use PyMapping_HasKeyString since PyDict_GetItemString is discouraged
Fidget-Spinner 2e3195d
fix reference leak
Fidget-Spinner d8b3a09
remove unused variable, add more specialization fails
Fidget-Spinner 25b002c
don't allow specialized function calls when tracing
Fidget-Spinner 557e4bc
deopt when tracing
Fidget-Spinner e554d64
Merge remote-tracking branch 'upstream/main' into call_function_speci…
Fidget-Spinner ea0d432
apply mark's comments
Fidget-Spinner 97749b7
change deopts to asserts
Fidget-Spinner feb966a
add blank lines between each case
Fidget-Spinner 9a5a407
Remove CALL_CFUNCTION_FAST
Fidget-Spinner 4dafd8d
Apply Mark's suggestions
Fidget-Spinner 84d2367
delete useless comment, add back useful one
Fidget-Spinner 12a5333
remove complicated checks for classes
Fidget-Spinner b99f65c
apply suggestions by Mark
Fidget-Spinner 5239342
actually move it into the block this time
Fidget-Spinner c4d6ca3
Merge remote-tracking branch 'upstream/main' into call_function_speci…
Fidget-Spinner 7250329
Regen opcodes
Fidget-Spinner c649070
move type earlier
Fidget-Spinner 5dfce16
change to assert
Fidget-Spinner 0da5ed2
increment unquickened stats
Fidget-Spinner 40b919f
Re-add CALL_FUNCTION_BUILTIN_FAST
Fidget-Spinner 75e3540
add check for C methods
Fidget-Spinner 3e2766c
Merge remote-tracking branch 'upstream/main' into call_function_speci…
Fidget-Spinner c06f5b8
Merge remote-tracking branch 'upstream/main' into call_function_speci…
Fidget-Spinner 3c1129a
fix build errors
Fidget-Spinner 226c591
Add CALL_FUNCTION_LEN
Fidget-Spinner 2dc2738
add CALL_FUNCTION_ISINSTANCE
Fidget-Spinner 7bd4338
fix specialization stats
Fidget-Spinner e2aada7
Merge remote-tracking branch 'upstream/main' into call_function_speci…
Fidget-Spinner f8c0957
Merge remote-tracking branch 'upstream/main' into call_function_speci…
Fidget-Spinner 2500ab6
Refactor
Fidget-Spinner 08ef4d8
convert to static
Fidget-Spinner 41f6fa6
fix news and formatting
Fidget-Spinner 8b113d1
remove typo
Fidget-Spinner 9642df5
remove nit
Fidget-Spinner 8a74cff
fix wrong return code
Fidget-Spinner 907c5cb
partly address code review
Fidget-Spinner 3e09485
Exclude function if not collecting stats
Fidget-Spinner b28d85c
check for error first
Fidget-Spinner 617424b
Record cache hit earlier
Fidget-Spinner e73b69f
fix isinstance bug
Fidget-Spinner f191720
apply suggestions from review: move up cache hits
Fidget-Spinner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Core and Builtins/2021-06-28-22-23-59.bpo-44525.sSvUKG.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Specialize ``CALL_FUNCTION`` opcode with ``CALL_CFUNCTION``. This speeds up | ||
calls to ``PyCFunctionObject``. As a result, many builtin functions and | ||
C-extension functions should experience reduced call overhead. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.
Uh oh!
There was an error while loading. Please reload this page.