News for hackers. Stuff that matters.
Re:Attempts to make Python fast by overgard on Wednesday October 21, 2020 @12:15PM (#24849240)
I don't think that's really true, those things are definite challenges, but PyPy is still significantly faster than CPython while (afaik) allowing that sort of stuff to go on. If you wanted C/Rust level performance than yeah, you need to redesign the language, but if you just want an interpreter that runs 5-10x faster than what they have now? Both doable and has been done.
Re:Attempts to make Python fast by Rochus on Wednesday October 21, 2020 @12:56PM (#24849686)
PyPy is about four times faster than CPython (https://speed.pypy.org/) which is not that much compared to the effort. Node.js is about 13 times faster (https://benchmarksgame-team.pages.debian.net/benchmarksgame/...).
Re:Attempts to make Python fast by nomel on Wednesday October 21, 2020 @01:28PM (#24850053)
For a funny perspective, there’s a python interpreter, written in JS, that is toe to toe with cPython, and faster in many benchmarks: https://brython.info/speed_results.html
Re:Attempts to make Python fast by kzrdude on Wednesday October 28, 2020 @07:24PM (#24925320)
Super cool - but how sad that it's only in the browser, not a complete Python implementation. The page forgets to mention if lower or higher is better.
Re:Attempts to make Python fast by overgard on Wednesday October 21, 2020 @01:35PM (#24850139)
4 times is a huge boost, and that's on average. For certain operations it's much much faster. Also comparing a volunteer project to an interpreter that has the resources of google behind it is IMO pretty unfair.

Also saying the effort of PyPy is purely around speed is misleading. After all, another huge goal of the project was to implement a python interpreter in python, which they succeeded at.

Re:Attempts to make Python fast by Rochus on Wednesday October 21, 2020 @01:51PM (#24850286)
> 4 times is a huge boost, and that's on average.

It's in geometric mean, not average (see http://ece.uprm.edu/~nayda/Courses/Icom5047F06/Papers/paper4...). The same principle is applied to all testees. It's normal that certain benchmarks run faster than others. That's why we compare geometric means.

> Also comparing a volunteer project to an interpreter that has the resources of google behind it is IMO pretty unfair.

Didn't the project run for nearly twenty years with seveal rounds of EU funding? I think it's rather the approach than the team size or corporate support. See e.g. LuaJIT which was implemented by a single person in a shorter time frame and achieves similar performance like Node.js.

> Also saying the effort of PyPy is purely around speed is misleading

Didn's say that. But unfortunately also the other RPython based implementations also don't seem to be faster.

Re:Attempts to make Python fast by Rochus on Thursday October 22, 2020 @07:37AM (#24856950)
Re:Attempts to make Python fast by the_mitsuhiko on Wednesday October 21, 2020 @01:16PM (#24849915)
And PyPy breaks some Python code (eg: most C extensions are very slow) in the process. PyPy is a different dialect of Python.
Re:Attempts to make Python fast by overgard on Wednesday October 21, 2020 @01:30PM (#24850086)
Slow != Breaks. I've run plenty of production python code in pypy. I'm sure it's not appropriate everywhere, but I wouldn't go so far as to call it a separate dialect.
Re:Attempts to make Python fast by Rochus on Wednesday October 21, 2020 @01:19PM (#24849950)
CPython could implement an alternative, more efficient FFI (such as e.g. the one by LuaJIT) which would not slow down PyPy. So people could gradually migrate.
Re:Attempts to make Python fast by sk2020 on Wednesday October 21, 2020 @03:54PM (#24851386)
Being 13x faster is not a compelling enough reason to use Node, in my opinion.
Re:Attempts to make Python fast by the_mitsuhiko on Wednesday October 21, 2020 @12:41PM (#24849502)
> PyPy is still significantly faster than CPython while (afaik) allowing that sort of stuff to go on

First of all that's only true when it managed to jit the code, secondly only until you try to do any of those slow things. For instance the C ABI emulation they have both cannot support all of CPython and wrecks performance. The same is true if you try to do fancy things with sys._getframe which a lot of code does in the wild (eg: all of logging).

In addition PyPy has to do a lot of special casing for all the crazy things CPython does. I recommend looking into the amount of engineering that went into it.

Re:Attempts to make Python fast by overgard on Wednesday October 21, 2020 @01:29PM (#24850064)
Yeah, but most code doesn't use things like sys.getframe? I don't see the problem here. You can choose whether those features are worth the speed penalty or not.

And yeah the C ABI is slow, but that's true of practically every language. Again, it's a choice of if you use those things or not. That doesn't devalue making other parts of the language faster.

Re:Attempts to make Python fast by kissgyorgy on Wednesday October 21, 2020 @12:33PM (#24849434)
PyPy is faster at the price of higher memory usage, which is not always desirable.