Hacker News new | ask | show | jobs
by Matheus28 267 days ago
Your python code allocates an array and inverts it every function call.

The C++ code has no overhead and is equivalent to a compile time transformation.

1 comments

Of course. But if I had to care about things on that level, and I was willing to sit through the C++ compilation process (and everything else that goes along with that), I wouldn't be using Python in the first place.