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.
while loading Perl 5 interpreter takes about 9 seconds.
I guess you meant 0.009 seconds? :)
Thanks for the correction :)
$ 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.
The great thing with humanity is that we do not need to agree :)
I know parrot and rakudo are not yet optimized. I know that no effort was put on that task yet. But I do not agree that it is too early to perform simple benchmark tests. It is important to have a clear idea of how things are, how much time they are taking. If instead of 2 seconds the test resulted in 5 seconds, or 10 seconds, I do not think parrot and rakudo developers will have the same feeling.
Regarding marketing, I think this whole thing of having Perl 6 being developed for years did enough marketing. At the moment, any post that can say Perl and Perl 6 are alive is better than nothing.
But again, points of view :)