4 ms·
Python is both an interpreter, and quite dynamic. Both of these lead to lower performance when compared to less dynamic, compiled solutions. All of Java, Go,
by __d 3y ago
Python is both an interpreter, and quite dynamic. Both of these lead to lower performance when compared to less dynamic, compiled solutions. All of Java, Go, and .NET are compiled and (much) less dynamic.
This is absolutely an expected outcome.
- cypress66 3y agoNode is pretty performant for anything IO related, not compiled and reasonably dynamic.
- __d 3y agoI think it's worth the clarification that Javascript is usually JITed; (C)Python isn't. And that CPython's I/O isn't really the problem: some of its async event loop implementations are fairly competitive with Node. But still ... yes. Javascript has benefited from two decades of intensive, well-funded work by the best people in the business, with clear focus on performance as a high priority goal. Not to take away from those who work on Python, but I think it's fair to say the effort has had orders of magnitude difference. I don't have a deep enough understanding to say whether the nature of Python or Javascript makes one better suited for performance optimization than the other. Python is perhaps able to benefit from seeing what's been done with Javascript, although of course Javascript has stood on the shoulders of its own giants.
- mike_ivanov 3y ago"absolutely an expected outcome." Good day. Is it the right time to talk to you about Common Lisp?
- tsimionescu 3y agoTo be fair, if you use CL in a similarly dynamic way as Python (don't compile anything, don't add any declarations etc) it won't be that much faster. You'll get some boost out of the stdlib stuff being compiled already, but otherwise it will incur similar performance penalties.
- __d 3y agoAlways a good time.
- gpderetta 3y agoThese days even elisp can be compiled. I think python need to be dragged kicking and screaming into cutting edge '80s dynamic compilation technology.
- __d 3y agoI'm sure skilled volunteers would be very welcome. There are numerous active, moderately serious efforts to both optimize and/or JIT Python bytecode. I think AOT compilation is mostly out-of-scope for 100% compatibility, but again, there's lots of different efforts to compile either subset languages or subsets of programs. "Kicking and screaming" suggests some reluctance to embrace this, but I think that's probably unfair: it's just hard.
- pjmlp 3y agoIt isn't as if PyPy doesn't exist. Embracing it during the 16 years of its existence is another matter.