2 ms·
But there is no dependency on the expressions on either variant, so there is no reason why the first variant is faster than the second in principle (of course p
by gpderetta 3y ago
But there is no dependency on the expressions on either variant, so there is no reason why the first variant is faster than the second in principle (of course python internals will get in the way and make it hard to reason about performance at all).
- reitzensteinm 3y agoNot sure why you're being downvoted, because you're right. To back up parent's point, if you compile the code and the resulting assembly is a direct translation, renaming will break the dependency and the CPU will execute the instructions in parallel. Write after read hazard is the applicable section: https://en.wikipedia.org/wiki/Register_renaming https://en.wikipedia.org/wiki/Register_renaming
- gpderetta 3y ago[off topic, but I expect that some amount of downvotes are people misclicking; I know that I found myself correcting many of my own, I wonder how many I don't catch]