3 ms·
> Overall I think people don’t clearly state the speed trade-off Python presents. Everyone focuses on the “40 times slower” part and nobody points out that “equ
by jlarocco 8y ago
> Overall I think people don’t clearly state the speed trade-off Python presents. Everyone focuses on the “40 times slower” part and nobody points out that “equivalent program in C++” is a glib false equivalence, because a truly equivalent program would have to offer all the same run-time dynamic type manipulation and nearly arbitrarily modifiable object instances involved.
Unfortunately, Python doesn't do well by that standard, either. For a few years now I've switched to Common Lisp for all of my small projects, and IME it's 20-30 times faster than Python by default, and more dynamic and flexible.
Declare types and turn on optimizations, and it's more like 30-40 times faster, though still generally a little slower than C or C++. And then it also can access C and Fortran libraries to speed things up further.
I like Python, it's my second favorite language, but it's not perfect.