The only Python programs that can be called "blazingly" fast compared to equivalent programs in performant languages are either spending all their time in I/O, or all spending all their time in C. Python is a nice language and with some tricks you might speed it up by a factor 2-10, but writing the same program in, say, Java, will often be 50-100x faster.
Exactly. And then after the "blazingly" fast clickbait title we read:
"I'm (mostly) not going to show you some hacks, tricks and code
snippets that will magically solve your performance issues. This
is more about general ideas and strategies, which when used, can
make a huge impact on performance, in some cases up to 30%
speed-up."
Python CPU-bound programs are e.g. 30 times slower than C or Java, and "up to 30% speedup" makes them still 20 times slower which is really far from "blazingly".
Yes, but writing C is a completely different, and much more onerous experience. You have no sensible strings or hashmaps in the standard library, and using external libraries is a massive pain. That's not even to mention Undefined Behaviour and memory safety issues.
For most data-munging programs, python, node, java, and rust code will be roughly similar (Java and Rust will make you annotate types). I've been amazed at the performance you can get from Rust code that looks practically identical to the equivalent JavaScript.
To be honest I find both the fastest C and Rust answers ("C gcc #6" @ 1.64s and "Rust #6" @ 1.70s) highly unreadable.
For me, "Rust #5" @ 1.98s is the first readable solution in the list, and seems comparable (code wise) with the Java, Python, etc implementations. ("C++ g++ #6" is also quite reasonable, but that's C++, not C).
Yeah and if you look at the Python program with the best performance compared to C you'll see that it spends all its time in gmpy2, which is exactly the same library C uses. Python still manages to be 2x slower.