Live data from Hacker News

PyPy v5.8 released

morepypy.blogspot.com

31–40 of 74 posts

Re: PyPy v5.8 released

#31

Coming from someone who uses python but doesn't really follow alternative compilers, PyPy sounds great. What are some of the downsides, if any? Are you sacrificing library compatibility for faster core+standard libs?

For workloads heavy on JSON operations PyPy has been slower than CPython for me in the past. Because it didn't benefit from the C implementation of simplejson.

Re: PyPy v5.8 released

#32
post #23

Earlier quoted context omitted.

Newsflash: code like this[1] will never be fast in CPython, and if you write a lot of code like that and are sad when it's slow then you need a different language, especially if you expect it to be as fast as a JIT compiled language like js on v8. Or use something like Cython. That benchmark is pretty meaningless anyway, IMO. Here are some halfway decent, official and up to date benchmarks comparing python 2 and pyth…

Ah the 'smart alec' has appeared. I'm not stupid, I know code like that won't be faster in Python but PyPy shows that it can be a hell of a lot faster than CPython and right up there with Node.js and the travesty is that CPython is so far off the pace and getting slower

Python 3.6.1 is a lot faster than 3.3.2 which was used back when the heap benchmark was done. In my system, 2.7.10 vs 3.6.1:

    C:\Test\PyBench>py -2 test.py
    Done in 1188.308127
    
    C:\Test\PyBench>py -3 test.py
    Done in 1454.897614
Please bring up to date benchmarks to the discussion, and stop complaining about old problems.

Note: adjusted I the workload to be 1000 less iterations, to get the results fast for this comment, so this numbers aren't comparable to the list in the github repo. But even if I hadn't done that, they wouldn't be because I ran these in my system.

Re: PyPy v5.8 released

#33
post #23

Earlier quoted context omitted.

Newsflash: code like this[1] will never be fast in CPython, and if you write a lot of code like that and are sad when it's slow then you need a different language, especially if you expect it to be as fast as a JIT compiled language like js on v8. Or use something like Cython. That benchmark is pretty meaningless anyway, IMO. Here are some halfway decent, official and up to date benchmarks comparing python 2 and pyth…

Ah the 'smart alec' has appeared. I'm not stupid, I know code like that won't be faster in Python but PyPy shows that it can be a hell of a lot faster than CPython and right up there with Node.js and the travesty is that CPython is so far off the pace and getting slower

I'm not a "smart alec" for pointing out that Python is, was and will be bad at heavily numerical, number crunching code. It's not what Python is built for.

I mean... it takes 28 bytes to store a single integer in Python.

> > sys.getsizeof(1)

> 28

Re: PyPy v5.8 released

#34
post #16
post #10

Earlier quoted context omitted.

I can't answer how numpypy is going, but Numba works pretty well for me to write fast numeric code in python. A bit restricted language and installing llvm is a bit of a hassle, but overall it's great.

That's CPython and the reason you're not noticing its slow is probably because most of your time is spent computing inside compiled library functions.

Numba is a Python compiler: http://numba.pydata.org/

So the fast functions they are using are likely compiled, they aren't necessarily library functions.

Re: PyPy v5.8 released

#35

Earlier quoted context omitted.

>comparable to some compiled languages Given that python programs usually run an order of magnitude slower than compiled languages even a 2x performance increase doesn't put it in the "comparable" range from my experience. Not bashing python - I use it regularly - but for computational stuff it's a hog unless you're just passing stuff to C libs - like I have a resource build pipeline that does some blender 3D model t…

It all depends on the task -- if your program is calling into optimized C-extensions anyway, converting the whole thing into a compiled language of course offers less of a speedup.

[deleted]

Re: PyPy v5.8 released

#36

Earlier quoted context omitted.

>comparable to some compiled languages Given that python programs usually run an order of magnitude slower than compiled languages even a 2x performance increase doesn't put it in the "comparable" range from my experience. Not bashing python - I use it regularly - but for computational stuff it's a hog unless you're just passing stuff to C libs - like I have a resource build pipeline that does some blender 3D model t…

As long as you use the python procedures that are written in C you will not really get much by using pypy. Try it yourself, write some IO and string heavy code and compare. [1] But as you say: for numeric computations python is slow as molasses. [1] or just look at something like https://github.com/juditacs/wordcount/blob/master/README.md . The simple py2 version is 2.5 times slower than a java version someone spent…

That was the point of the Heap Benchmarks. In CPython you would have to use HeapQ, writing something yourself in Python will be miles off the pace. Whereas in PyPy the Python implementation of a Heap or your own version is comparably fast. As it should be. The 'hunt down the written in C' parts of the standard library is what I am increasingly objecting to.

Re: PyPy v5.8 released

#37

I have a question and then a general vent 1. Does anyone know the latest update on NumPyPy? PyPy for me is just not a usable proposition because I heavily use Numpy (and Scipy et al). So I am forced to use slow Python + fast Numpy or slow Numpy + fast Python. Very saddening. The C-Extension is just so off the pace, NumPyPy was meant to solve that quandry. And I know some smart Alec will trot out the usual 'downshift…

Even Javascript is fast? Microsoft, Apple, Google and Mozilla have all invested heavily in making that happen.

Re: PyPy v5.8 released

#38

Earlier quoted context omitted.

Ah the 'smart alec' has appeared. I'm not stupid, I know code like that won't be faster in Python but PyPy shows that it can be a hell of a lot faster than CPython and right up there with Node.js and the travesty is that CPython is so far off the pace and getting slower

Python 3.6.1 is a lot faster than 3.3.2 which was used back when the heap benchmark was done. In my system, 2.7.10 vs 3.6.1: C:\Test\PyBench>py -2 test.py Done in 1188.308127 C:\Test\PyBench>py -3 test.py Done in 1454.897614 Please bring up to date benchmarks to the discussion, and stop complaining about old problems. Note: adjusted I the workload to be 1000 less iterations, to get the results fast for this comment,…

Python, R and other languages are just slower. If that is an issue I again will agree you need to move to another language.

Can I ask what you need the speed for? How long are your reports running? Because a lot of times the reports run in under a few minutes and people just don't sub-set their data to code on. People feel it is "BIG DATA" when it is just annoying data that takes less then a minute to spit out.

Re: PyPy v5.8 released

#39
Why are they still comparing to Python 2.7.2? I couldn't find benchmarks against Python 3.5 for their Py3 interpreter.

All the times I tried PyPy I came into a hurdle where one of the libraries I needs doesn't work (or underperforms) in PyPy, the most important ones being Numpy and OpenCV.

So in the end I just gave up with them, and stuck with Python 2/3 and Cython, which solved my speed problems without having to do all the work of C-extensions from the ground up.

Edit: the one benchmark I found covering PyPy3 is this: https://pybenchmarks.org/u64q/benchmark.php?test=all&lang=py...

It shows PyPy3 5.7.1 being about 8x faster to 100x slower than CPython 3.6.1.

For comparison, PyPy2 5.7.1 ranges from 10x faster to a bit over 30x slower to than CPython 2.7.13.

Re: PyPy v5.8 released

#40
post #22

Earlier quoted context omitted.

I think the core devs are doing a fine job with CPython as the reference implementation and developing PyPy takes a different set of expertise; JIT and compilers specifically. I think sponsorship of PyPy would be welcome -- but it seems non-obvious where that would come from. Javascript has the fortune of being the language that drives a very important platform -- and Chrome has been a particularly strategic investme…

Java has much more than Android. Besides the enterprise space, there are lots of embedded devices running it.

Android doesn't even run the JVM.
Post reply on HN