by tasubotadas · 4y ago · 0 comments
(It actually changes a whole lot, because there's a whole lot of code already out there written in Python. 25% faster is still 25% faster, even if the code would have been 100x faster to begin with in another language.)
And that's even assuming that the code would have existed at all in another language. The thing about interpreted GC languages is that the iterative loop of creation is much more agile, easier to start with and easier to prototype in than a compiled, strictly typed language.
Python is excessively dynamic, so it can't (conventionally) be sped up as easily as many other languages unfortunately. Finally some folks are being paid and allowed to be working on it.
It's about on par with Ruby, only Lua and JIT compiled runtimes beat it (for very understandable reasons).
def fooer(i: str, strings: list[str]):
push = str.append
for s in strings:
push(i, s)
Apparently this helps the interpreter understand that `append` is not getting overwritten in the global scope elsewhere.Common Lisp and Java begs to disagree.
Python is used in so many different areas, in some very critical roles.
Even a small speedup is going to be a significant improvement in metrics like energy use.
The pragmatic reality is that very few people are going to rewrite their Python code that works but is slow into a compiled language when speed of execution is trumped by ease of development and ecosystem.
[0] https://github.com/markshannon/faster-cpython/blob/master/pl...
Does not sounds like Rust.
(But other than that I agree with your point.)
Doing side by side comparisons between golang and python on Lambda last year, we halved the total execution time one a relatively simple script. Factor of 100, I assume, is an absolute best case.