News for hackers. Stuff that matters.
Re:Python’s Weak Performance Matters by ohyes on Wednesday February 07, 2018 @01:42AM (#16322678)
“Lies, damn lies and benchmarks” I think is the saying.

Python itself is a slow language but it has a lot of fast packages, so it shows poorly when you actually write your benchmark in python.

Haskell is a faster language but because it is high level there are more pitfalls you’ll get into if you don’t know the ins and outs of getting fast code out of the compiler. The guys who write fast benchmark code aren’t ‘average’ developers.

So in Haskell it’s “the code is slow and I don’t know why” vs python “the code is slow because python is slow, import fast package someone wrote to speed it up.”

All that said, I think Haskell is the better language but you have to put in more effort to get experienced in it before you see returns on the investment. Python has a shallower learning curve and an easy way to get “good enough” performance (a bit slower than C).

The best criticism in the article is of the multi-core deficiency of python’s interpreter. But that’s only briefly touched on. It isn’t a friendly environment to write complicated multi core code.

Re:Python’s Weak Performance Matters by acqq on Wednesday February 07, 2018 @02:06AM (#16322756)
> Python has a shallower learning curve and an easy way to get “good enough” performance (a bit slower than C).

The article we all reply to exactly claims that as soon as you don't use e.g. NumPy, it's not "good enough" anymore, and I agree with that. The article also argues that e.g. JavaScript isn't more in the same category with Python, but much faster, even if it's not less dynamic.

I think the reason for JavaScript's speed vs. Python's slowness is obvious: there were wealthy companies involved, which were, due to competition pressures, motivated to speed up their own JavaScript engines.

To get to the point where Python has similar speeds somebody would have to be motivated enough to invest heavily, and then it could happen. As far as I know, there aren't technical limitations against that.

Re:Python’s Weak Performance Matters by ShroudedNight on Wednesday February 07, 2018 @04:49AM (#16323330)
Having actively worked on a JIT compiler for CPython; in retrospect, JavaScript had a significant advantage over python: the expected requirement of one's JavaScript code to run more-or-less compatibly on a variety of interpreters.

So much Python has historically been tied to CPython's specific ideosyncracies that there is significantly more onus on the upstart VM developers to maintain compatibility with paralinguistic behaviour (things like expectations regarding object destruction sequencing).

Re:Python’s Weak Performance Matters by guitarbill on Wednesday February 07, 2018 @06:12AM (#16323686)
It seems like the downfall of anything non-CPython is either the C API or the GIL, although I'm shocked at how good package support is looking for PyPy now (http://packages.pypy.org). Makes me want to try it again.

Javascript also has the "benefit" of an appalling base library, while the base library that CPython provides is quite large, and growing.

Re:Python’s Weak Performance Matters by pjmlp on Wednesday February 07, 2018 @03:12AM (#16322949)
Every time this comes up, there are also the good examples of Lisp, Dylan and Smalltalk as languages that as dynamic as Python, while enjoying relatively good JIT compilers.
Re:Python’s Weak Performance Matters by e12e on Wednesday February 07, 2018 @03:33AM (#16323045)
Which of course python has too (pypy). Although it depends on what your bar for "relatively good" is.
Re:Python’s Weak Performance Matters by pjmlp on Wednesday February 07, 2018 @04:32AM (#16323263)
Sure, but PyPy seems to be largely ignored and I commend their developers for being so persistent.