Replace if xxx is None:
with POP_JUMP_IF_NOT_NONE
?
#154
Replies: 9 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
See also #36 |
Beta Was this translation helpful? Give feedback.
-
Thanks for writing the code and conducting the benchmarks! Unfortunately, 10% speedup on a microbenchmark usually means 0 real-world speedup, so depending on how complex the code is, I don't know if it's worth it :(. |
Beta Was this translation helpful? Give feedback.
-
@penguin-wwy Is the code on a publicly visible branch? |
Beta Was this translation helpful? Give feedback.
-
Moving to a discussion. @penguin-wwy if you want to contribute your code please open a PR and reference this issue or the resulting GitHub Discussion. |
Beta Was this translation helpful? Give feedback.
-
I added a few simple optimizations, and the performance is better than before. ./bin/python3 -m pyperf compare_to -G --table ../main/main.json jump_is_none.json --min-speed 2 --table-format md
|
Beta Was this translation helpful? Give feedback.
-
The PR is merged and https://bugs.python.org/issue46031 is closed. Close this? |
Beta Was this translation helpful? Give feedback.
-
This is a discussion, not an issue. I don't think discussions can be "closed" (just locked or deleted). I think it's fine the way it is. Although maybe we could have a label for "finished" discussions to make the current status a bit clearer? |
Beta Was this translation helpful? Give feedback.
-
Still learning github. Looking at the headers, I see the difference now. |
Beta Was this translation helpful? Give feedback.
-
These codes will be compiled to
I add new instr
POP_JUMP_IF_NOT_NONE
andPOP_JUMP_IF_NONE
to replace these:This is very effective for such a sample:
Call this function 1, 000, 000 times
After optimization, 10%+ speedup.
Result on pyperformance:
However, I am confused about, why
pickle_dict
is so slow ? This case is just calling the CFunction in the loop !Beta Was this translation helpful? Give feedback.
All reactions