Replies: 4 comments 9 replies
-
It seems this specialisation is going to have a lot of misses. When specialising it doesn't check the add op is assigning back to the 1st argument, just that the LHS argument has a refcount of 2. So it'd trigger for |
Beta Was this translation helpful? Give feedback.
-
Yup, the I personally like the side-effect of including (Also, I think this means |
Beta Was this translation helpful? Give feedback.
-
Adding some debugging code, it looks like this method in the re module is a major source of the instability: In particular, with some hasty printf debugging
I got things like this
|
Beta Was this translation helpful? Give feedback.
-
Since this specialization seems rather miss-prone, one solution would be to be more permissive in what is allowed to pass DEOPT_IF checks, and then have a branch in the instruction body to check whether we can operate in place, and to do so if possible, but to create a new str object if not. In other words, if specialization catches a situation where we can operate in place, we interpret this as meaning that this bytecode only sometimes is able to operate in place. In fact, Too many misses? Eliminate the code that checks for misses ;-) |
Beta Was this translation helpful? Give feedback.
-
According to https://github.com/faster-cpython/ideas/blob/main/stats.md:
I measured individual benchmarks with
rm C:\temp\py_stats\*; .\python.bat .\Lib\site-packages\pyperformance\benchmarks\bm_regex_compile.py --fast; .\python.bat .\Tools\scripts\summarize_stats.py
:This seems to point to something within pyperf/pyperformance doing some string concatenation with
+=
.Beta Was this translation helpful? Give feedback.
All reactions