Live data from Hacker News

PyPy 2.0 Released

morepypy.blogspot.com

41–50 of 77 posts

Re: PyPy 2.0 Released

#41
post #21

Earlier quoted context omitted.

Are you saying PyPy is unreadable? I have not read large amounts of it, but the interpreter is written in RPython. Surely it's easier to read than the CPython source?

readability is probably not the right term, but I think he means easy to understand. Doesn't matter how elegant PyPy's code is, it'll surely be more complex than an straight forward interpreter.

PyPy is a straightforward interpreter. It's just written in a language with good JIT compiler (RPython).

Re: PyPy 2.0 Released

#42
post #4

Congratulations! Looking forward to the day PyPy becomes the reference implementation.

In many cases, you want to be careful about using JIT'd platforms. Many people forget that the memory requirements skyrocket. When you want to use a language on many different platforms, including embedded, you start to see how having a JIT interpreter as your reference platform can be disadvantageous. CPython isn't exactly slow either, especially when you consider many 'intensive' modules are written directly in C.…

almost agree, except for the 'experiment' part. i don't want it to be an experiment, i want it to be a production-ready interpreter that i can use instead of cpython with minimal effort when i know i can trade memory for speed.

Re: PyPy 2.0 Released

#43
post #41

Earlier quoted context omitted.

readability is probably not the right term, but I think he means easy to understand. Doesn't matter how elegant PyPy's code is, it'll surely be more complex than an straight forward interpreter.

PyPy is a straightforward interpreter. It's just written in a language with good JIT compiler (RPython).

Small correction: a language for which good JIT compilers can be generated for interpreters written in it.

Re: PyPy 2.0 Released

#44

What are the largest sites using PyPy in production?

quora did at some point but it seems they replaced it (or some usage of it) with scala, I can't find any pointer at the moment but google could help you.

Re: PyPy 2.0 Released

#46
Whilst I applaud the efforts of PyPy, I've always been disappointed with the performance benefit it's given me with real world code.

Specifically:

* PyPy Dict performance is very slow (slower than Cpython). A lot of the code I need to write that is cpu-intensive python code processes data (from stuff like logs) into various data structures that use dicts. Pypy is rarely more than 10% faster and sometimes slower.

* The memory management/GC can be bad. I've seen the same code that runs fine on cpython end up using excessive amounts of memory (and causing out of memory issues etc) with PyPy. Again - this is normally involving complicated data-structures.

On about 10 occasions now I've had CPU bound Python tasks, then I've tried to use with PyPy and never had > 20% performance improvements. Which is a big contrast with the benchmarks.

Is it just me? Or have other people had similar experiences?

[edit: typos]

Re: PyPy 2.0 Released

#47
post #6

Does anyone have any performance comparisons to Perl? I've used Perl for over a decade. Just started using Python on a project. I've got a lot to learn but Python makes you feel like you've got it down pretty quickly. One of the things that kept me on Perl was its great performance. http://benchmarksgame.alioth.debian.org/u64q/perl.php I'd like to go for the win, win. Is that 'FTWW?'

I'm not aware of a direct comparison of Perl and PyPy. However, for a paper I co-authored, we put together an experiment with various languages and VMs, using the language shootout plus a few other benchmarks:

  http://tratt.net/laurie/research/pubs/files/metatracing_vms/
Cross-langauge benchmarks are inevitably synthetic, and synthetic benchmarks can only tell you so much. It's important not to over-interpret them. But they can give you a rough idea of what's going on, at least in some circumstances. If someone wanted to add Perl to the experiment set, I'd gladly accept a patch to the benchmarking suite.

Re: PyPy 2.0 Released

#48
post #35
post #32

Earlier quoted context omitted.

I think regex performance of Perl is nothing extraordinary. What it is famous for is pushing the scope of matching beyond regular languages. Of all the common scripting languages I think TCL uses a different algorithm for regex matching and is considerably faster than Perl, especially on longer strings. Let me find some corroborating docs. Ok this has some info http://swtch.com/~rsc/regexp/regexp1.html

Exactly. Perl regexes have _poor_ performance in terms of running time, but good usability, including by squeezing non-regular features into their allegedly-regular expressions, and also things like numerous and flexible character classes, consistent behaviour for escapes, etc. I love vim, but jesus I can never remember which vim regex metacharacters need escaping to get their meta-meaning, and which need escaping to…

\v is your friend.

http://vimdoc.sourceforge.net/htmldoc/pattern.html#/magic

Re: PyPy 2.0 Released

#49
post #46

Whilst I applaud the efforts of PyPy, I've always been disappointed with the performance benefit it's given me with real world code. Specifically: * PyPy Dict performance is very slow (slower than Cpython). A lot of the code I need to write that is cpu-intensive python code processes data (from stuff like logs) into various data structures that use dicts. Pypy is rarely more than 10% faster and sometimes slower. * Th…

The benchmarks are a little bit misleading for some types of code. They do not measure single run code well. In these cases pypy doesn't do as well as when the JIT has warmed up.

The interpreter is slower than the CPython one. For code which doesn't JIT well, it will go slower with pypy. The firefox JS engine now has a fast interpreter, a quick JIT, and a more optimizing one. This means the baseline performance is better in CPython, so if pypy manages to make their interpreter better baseline performance will get better.

The memory management in CPython is much more predictable and deterministic since it is using reference counting and not GC. The pypy GC may be faster in many circumstances however. IO in pypy can be slower sometimes if the GC is unhappy with the way you're doing it. Especially if you're leaving files open, or reading in different sized chunks of data.

The new pypy release speeds up a few different types of real world code however. XML processing, DB processing, and stackless async code (eventlet, and greenlet) are three areas where pypy has improved with this release. Numpy based code is another area where pypy has gotten better with this release.

In short, pypy still has many areas where it could improve... but with each release is getting better at more types of real code :)

For run-once, and latency or memory sensitive code the benchmarks may be a bit misleading.

Re: PyPy 2.0 Released

#50
post #46

Whilst I applaud the efforts of PyPy, I've always been disappointed with the performance benefit it's given me with real world code. Specifically: * PyPy Dict performance is very slow (slower than Cpython). A lot of the code I need to write that is cpu-intensive python code processes data (from stuff like logs) into various data structures that use dicts. Pypy is rarely more than 10% faster and sometimes slower. * Th…

I've had exactly the same problem. I have had tree-manipluation AI problems which run for > 30 minutes (seems like an ideal thing for pypy, before I rewrite them in C++). pypy is almost always slower, and never more than about 15% faster, whereas a simple line-by-line C++ rewrite can be 20x faster.
Post reply on HN