(no title)
billyzs | 2 years ago
Not sure I follow, isn't Python single threaded by default? Changes to GIL is coming but does it change how the interpreter uses CPU?
billyzs | 2 years ago
Not sure I follow, isn't Python single threaded by default? Changes to GIL is coming but does it change how the interpreter uses CPU?
kristofferc|2 years ago
danybittel|2 years ago
gpderetta|2 years ago
epcoa|2 years ago
This is much more likely a quirk of the interpreter (or possibly a fucked up test). CPU details are like 10000 feet down.
ufo|2 years ago
A CPU can do more than one thing at once by computing the next instruction while it's still writing the result of the previous one. However, the CPU can only do that if it's 100% sure that the next instruction does not depend on the previous instruction. This optimization sometimes can't trigger in an interpreter, because of highly mutable variables such as the program counter or the top of the interpreter stack. Fun illustration: https://www.youtube.com/watch?v=cMMAGIefZuM&t=288s
saagarjha|2 years ago
kunley|2 years ago
I guess the first thing worth doing when analyzing this would be looking at the differences in the bytecode, then looking at the C code implementing the differing bytecode ops. But there also other factors, like the new adaptive interpreter trying to JIT the code.
zimpenfish|2 years ago
Single-line dual assignment:
vs the two-line version:unknown|2 years ago
[deleted]