News for hackers. Stuff that matters.
Re:PyPy 2.0 Released by melling on Thursday May 09, 2013 @04:21PM (#5682718)
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?'

Re:PyPy 2.0 Released by jholman on Thursday May 09, 2013 @08:03PM (#5683732)
Interesting datum you used. That chart shows that, on those compilers, on those programs, with those test data, Perl and CPython are VERY similar in speed. If you compare your link (Perl / CPython) with the inverse (CPython / Perl), you almost can't tell the graphs apart.

http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...

So CPython is about the same speed as Perl. PyPy's speed comparison suggests that PyPy is 2-20x faster than CPython. What else do you want to know?

Perl, btw, is not noted for its "great performance" in any context I've ever heard of.

Re:PyPy 2.0 Released by melling on Thursday May 09, 2013 @08:22PM (#5683798)
Perl is famous for it regex performance. For many years people have compared Python, Ruby, and Perl performance and it has usually been Perl as the fastest followed by Python then Ruby. I've seen many posts like this:

http://stackoverflow.com/questions/12793562/text-processing-...

These days, however, it appears that Python has really come into its own. I started using Sublime Text so that got me into trying out Python.

Re:PyPy 2.0 Released by srean on Thursday May 09, 2013 @09:43PM (#5684060)
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

Re:PyPy 2.0 Released by jholman on Thursday May 09, 2013 @10:10PM (#5684139)
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 get their non-meta meaning.

Re:PyPy 2.0 Released by Leszek on Friday May 10, 2013 @07:03AM (#5685542)
Re:PyPy 2.0 Released by jholman on Friday May 10, 2013 @01:21PM (#5687471)
I sort of prefer \V, but same difference

I dunno, I haven't used it in the past, because...

1) "It is recommended to always keep the 'magic' option at the default setting, which is 'magic'. This avoids portability problems."

2) Nor do I want to type two extra characters in every damn regex!

So, it only occurs to me right now, the right thing to do for me is this: the first instant I'm confused about whether \( means grouping or literal paren, I should immediately start my pattern with \v or \V. No unportability of plugins, no marginal cost on regexes that don't care, marginal benefit when it does matter.

Re:PyPy 2.0 Released by Leszek on Sunday May 12, 2013 @01:02PM (#5694915)
Yeah, that's basically what I do too. No \v on trivial regexes, \v on ones where there's more than one or two groups.
Re:PyPy 2.0 Released by wiremine on Thursday May 09, 2013 @07:02PM (#5683526)
I haven't seen Perl vs. PyPy stats, but here is some CPython vs. PyPy benchmarks:

http://speed.pypy.org/

Re:PyPy 2.0 Released by moonlight80 on Friday May 10, 2013 @03:02AM (#5685007)
Here are posts that compares CPython 2.7, 3.3 and PyPy 1.9:

1. web frameworks performance: http://mindref.blogspot.com/2012/09/python-fastest-web-frame... 2. template engine performance: http://mindref.blogspot.com/2012/07/python-fastest-template....

It would be interesting to see how PyPy 1.9 compares to 2.0 in those benchmarks.

Re:PyPy 2.0 Released by ltratt on Friday May 10, 2013 @06:34AM (#5685471)
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.