Hacker News new | ask | show | jobs
by richthegeek 5249 days ago
Python & Ruby are both slower interpreted languages than PHP, for all their lovely syntax.

The JVM is slower to develop for, and when probably 50% of projects on the web are stuff that's built in less than 2 months, using the JVM adds too much complexity where it really isn't needed.

If you want speed (almost) as good as the JVM without using an interpreted language, use Node. Unless of course you only know the one language from your CompSci days..

3 comments

> Python & Ruby are both slower interpreted languages than PHP

Source? That's not what the Programming Language Benchmark Game says...

http://shootout.alioth.debian.org/u64/which-programming-lang...

Although that's probably without an optimiser at all.

Maybe that should be qualified "in a web context".
Still a big [citation needed]. Compare with something like cached Mako templates in Python and I seriously doubt it's competitive.
Compare it with a micro-cached Varnish or nginx .. caching is outside of the "speed" parameters. Of course, you could take a look memcached if you want :)

I can't find the reference I remember but it fits roughly with the link posted (the scale seems to match the max times rather the average times). The differences were tiny but the order was PHP, Python, Ruby if I remember correctly (PHP was in front, PR may have been switched).

I'll try get a link but I doubt i'll find it.

In the case of Mako at least, caching doesn't mean caching in the way you mean it. It's more akin to opcode caching in PHP, saving the actual python code generated from the template, not the result. Just saves from reparsing the template every time it's rendered, but the actual template logic still runs.
Or use JRuby to get the advantages of ruby with the speed of JVM (http://jruby.org/).
I like JRuby a lot, in fact it's my favourite scripting language on the CLI, but while it's fast to run its damn slow to compile (remember it still has to compile to JVM bytecodes).
I think people often just don't know about recent developments.

PyPy is at least as fast as Node, and Rubinius is also very fast.