Benchmarking perl 5 and perl 6: part I - loading overhead

I know rakudo star is in its first releases. But it helps if we can start looking to it as a complete tool instead of a prototype, or we will never get out of the prototype.

Therefore, I decided to perform a simple test: run the usual "hello world" program from the command line, both with Perl 5 and Perl 6. After a bunch of runs, the average measures are:


$time perl -E 'say "hello"'
real 0m0.009s
user 0m0.004s
sys 0m0.005s

$ time perl6 -e 'say "hello"'
real 0m1.163s
user 0m0.982s
sys 0m0.166s


Expecting that the process of outputting a string if fast, this means that loading parrot and loading Perl 6 over it, takes about 1.163 seconds, while loading Perl 5 interpreter takes about 0.009 seconds.

In future posts I will try to compare commands efficiency.

8 Comments

while loading Perl 5 interpreter takes about 9 seconds.

I guess you meant 0.009 seconds? :)


$ time ./perl6 -e 'say "hello world"'
hello world

real 0m2.149s
user 0m1.890s
sys 0m0.240s
$ time jython -c 'print "hello world"'
hello world

real 0m3.169s
user 0m5.040s
sys 0m0.180s

I think it's far too early to start benchmarking. The Rakudo team knows that Rakudo is not very fast. They know it's important, but they really want to get the features correct lest they find themselves trying to figure out scary optimisations while hacking in new features. We've all been there and it's not fun.

I see so many people complaining about Rakudo's performance that I fear this is what is defining Rakudo in the minds of many who haven't followed the Perl 6 development process.

Somewhere I've also read complaints of the "incredible" size of the rakudo-star package.

I just finished packaging rakudo-star,
which is parrot, rakudo and the additional rakudo-star modules, blizkost and some docs.

See http://rurban.xarch.at/cygr/parrot/

parrot 1.1M
rakudo 1.6M
rakudo-star 378K

Compare this to the typical perl5 package with some basic modules as shipped with cygwin:

perl5 12M

And now compare this to a typical java package.

parrot-devel 597K
parrot-docs 391K
vs.
sun-java6-jdk 20.2 MB

Since when is executing "time foobar" called benchmarking? Is this a joke?

You're wrong on that one: Perl 6 hacking is optimised for fun! ;)

IMHO decent speed is not going to come before Lorito have been implemented.

Leave a comment

About Alberto Simões

user-pic I blog about Perl. D'uh!