http://www.perlmonks.org?node_id=139525


in reply to Re: (tilly) 3: Perl speed VS. other languages
in thread Perl speed VS. other languages

Well it is a known factoid: Perl compiles to high-level bytecode, ie many builtins compile to a single opcode, whereas Java bytecode mimics a real CPU, so you are essentialy pitting a P-code interpreter against a hardware emulator. The P-code is almost bound to win.

The well known strategy of optimizing Perl programs by tuning them to spend a maximum amount of time running builtins (see Schwartzian Transform f.ex) highlights this issue clearly. Java optimization is very different and much closer resembles traditional optimization.