-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add return const instruction #101632
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
Comments
Execution counts for all instructions in the main branch
And execution counts for all instructions in my branch
|
I have executed pyperformance on my server, compare to commit d3e2dd6
Although the performance gain may not be high, the side effects are minimal and should be a positive optimization. |
iritkatriel
pushed a commit
that referenced
this issue
Feb 7, 2023
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
From the pystats doc (pystats-2023-02-05-python-5a2b984.md), I find that
LOAD_CONST + RETURN_VALUE
is a very high frequency (Because the default return of the function is None).Successors for LOAD_CONST
And predecessors for RETURN_VALUE
This means that if we add a
RETURN_CONST
, we can reduce theRETURN_VALUE
instruction by 30% and theLOAD_CONST
instruction by 20%.From the microbenchmark that there is indeed a ~10% improvement (considering the interference of function calls, I think 10% should be there), which is not very high, but it should be an optimization without adverse effects.
Linked PRs
The text was updated successfully, but these errors were encountered: