3 ms·
I can't be sure without measuring, but I strongly suspect the overhead will be mostly in tuple packing/unpacking and GC. And I instinctively distrust Sufficien
by ajuc 6y ago
I can't be sure without measuring, but I strongly suspect the overhead will be mostly in tuple packing/unpacking and GC.
And I instinctively distrust Sufficiently Smart Compilers ;)
- eru 6y agoOh, your compiler doesn't have to be sufficiently smart. It merely has to avoid premature optimization: see this classic paper https://dspace.mit.edu/handle/1721.1/5753 https://dspace.mit.edu/handle/1721.1/5753 by Guy Steele. > I can't be sure without measuring, but I strongly suspect the overhead will be mostly in tuple packing/unpacking and GC. I guess that's the same overhead as in this imperative version: a, b = 0, 1 for _ in range(n): a, b = b, a + b