3 ms·
> Firstly, the program spends most of its time in the heavily-optimized str.find function, which is implemented in C. I'm not going to outright call this "chea
by staticassertion 8y ago
> Firstly, the program spends most of its time in the heavily-optimized str.find function, which is implemented in C.
I'm not going to outright call this "cheating", but most of the time, virtually unconditionally, when Python is fast it's because it isn't Python, it's C.
It definitely feels worth noting that Python is radically slower than other languages, and the main "tool" it provides for improving performance is to rely on another language entirely.
- zie 8y agoWell Python is written IN C, at least the standard version is, so I really wouldn't call it anywhere near cheating... :). But I don't disagree that the Python owe's it's performance to C.. it owes everything to C :)
- staticassertion 8y agoI think there's a very big difference between the runtime being implemented in C and the libraries being implemented in C.
- blattimwind 8y agoExample Java: Runtime written in C++, practically all libraries written in Java, including the standard library, and Java libraries are greatly preferred.