Re:When Optimising Code, Measure
by zimpenfish on Tuesday January 16, 2024 @07:48AM
(#39012705)
For Python 3.12, Godbolt gave almost identical bytecode for both (albeit in different order.) I'm guessing wildly but might this be because `BINARY_OP(+=)` stores the result (because it's `INPLACE`) and then you also do `STORE_FAST(x)` which gives you two stores for the same value compared with one store in the single-line version?
Single-line dual assignment:
vs the two-line version: