The Python "Need for Speed" Sprint
The Python "Need for Speed" Sprint
Posted May 28, 2006 22:40 UTC (Sun) by k8to (guest, #15413)In reply to: The Python "Need for Speed" Sprint by jengelh
Parent article: The Python "Need for Speed" Sprint
It's well known that perl is faster than python. Python stack frames are
heavier; python variable access is heavier. It _might_ be that the
regexes are slower too, and it wouldn't surprise me, but I bet they use
PCRE, so I'd chalk it up to the overall language first.
That all said, I find that the speed difference quite rarely matters.
Posted May 29, 2006 2:44 UTC (Mon)
by amk (subscriber, #19)
[Link]
Posted May 29, 2006 16:45 UTC (Mon)
by scottt (guest, #5028)
[Link] (2 responses)
Posted May 29, 2006 23:10 UTC (Mon)
by k8to (guest, #15413)
[Link]
Posted Jul 15, 2006 21:02 UTC (Sat)
by Barry (guest, #39099)
[Link]
There's some data based on the Computer Language Shootout at the bottom of this page.
On Debian : AMD Sempron, Python performed faster than Perl in 9 out of 15 benchmarks.
On Gentoo : Intel® Pentium® 4, Python performed faster than Perl in 13 out of 16 benchmarks.
Posted May 29, 2006 20:42 UTC (Mon)
by jafo (guest, #8892)
[Link]
Sean
PCRE was used in Python 1.5.2, but it doesn't support 16-bit Unicode characters (only UTF-8
encoded strings), so Python now uses its own regex engine.
Not PCRE
A microbenchmark comparing Perl and Python:
Computer Language Shootout
Actually Perl is not always faster
Actually beginning comments with "actually" is always slightly Actually Perl is not always faster
bothersome.
Actually Perl is not always faster
One of the areas that was worked on was speeding up function calls, including changes related specifically to the frames. There isn't much that can be done about reducing the frame size, but I think a small reduction was done there. However, Richard Jones spent the first day of the sprint updating a patch which used zombie frames so that repeated calls to a function would use a cached frame that was already mostly initialized.The Python "Need for Speed" Sprint
