I use python because I have to, but not because I want to. I have to think twice about using something as basic as a loop, whereas in another language I don't have to.
The article times bubble sort, which is just nested loops. And python is dead slow. Granted nobody uses bubble sort, but loops show up in all kinds of places in programming. With python, you always have to make a decision on whether to use python loops or let something like numpy or torch or pandas do the loop.
You don’t “always” or even “often” have to make decisions like that unless all you’re writing are loops which run very simple computations a large number of times. Bubble sort is good for measuring the innate operation dispatch efficiency but it’s somewhat uncommon to have that many iterations doing so many simple operations so many times outside of the domains where people typically use things like numpy. If these benchmarks were doing more substantial operations the gap shrinks dramatically because more time is being spent in CPython’s native code or things like I/O.
what would you prefer using? how do you compare python loops and those of that other language?