top | item 8981201

(no title)

mfrager | 11 years ago

I hope Perl 6 has better runtime speed and memory efficiency because those are the only downsides of Perl 5. However I seriously doubt that will be the case. Perl 6 will most likely be more bloated and slow, but I very much hope that I'm wrong.

Just for reference my company's software is all built with Perl 5 and runs great. Most of the execution time is within the database calls so there is no impact from using Perl over a marginally faster runtime like Python or Java.

discuss

order

SwellJoe|11 years ago

When did Python become faster than Perl 5?

I'm not trying to be argumentative, but the last realistic comparisons I did had Perl running quite a bit faster. For example comparing ack to grin, which are very similar projects in Perl and Python respectively...at the time, admittedly several years ago, ack was an order of magnitude faster than grin. I also wrote a few log parsers in both Perl and Python (at a time when I was working in a Python shop, so they preferred everything be done in Python). The Perl parsers were much faster than the Python variant, for exactly the same work (again, an order of magnitude difference). Perhaps this is just an example of Perl's domain of expertise...processing text is a big part of its origin story, and has always been a big part of what people use it for. Or, perhaps Python has made remarkable performance improvements in those intervening years. I haven't worked with Python in that time, so haven't followed development. Perl 5 has gotten faster in that time, too, though, so I'd be surprised if Python is dramatically faster for the same real world tasks.

latk|11 years ago

Perl5 has a lot of historical baggage that makes certain things difficult to do efficiently. For example, how objects work. There is an insane amount of indirection involved for a simple method call, and this indirection can't generally be removed if we want Perl5 to stay highly backwards-compatible. Numerics aren't particularly efficient either. Perl5's opcodes are very high-level. That makes each individual opcode pretty fast, but makes it difficult to inline stuff. Variables can have “magic” attached that can change their semantics substantially. While this is very flexible and allows to do some amazing things, this also requires this magic to be checked on each access. So Perl5 has a lot of features that rank high on “clever”, but low on “can be optimized”. Perl5 never got JIT support, and only has a couple of very experimental Perl-to-C transpilers.

What is fast is string handling and log mangling. Perl was created for that; everything else is bolted on.

rurban|11 years ago

With perl5 + Moose, perl6 beats perl5. In startup time and run time. With simple small scripts the small startup footprint of perl5 still elevates it over perl6.

perl6 has much more features than perl5, it's a completely different world. I wouldn't call that bloat.

pwr22|11 years ago

Wonder how Moo compares?