I'm giving a parrot status talk at the Boston perlmongers meeting wednesday, and trying to do the meet 'n greet at BioITWorld in Boston wednesday and thursday, so I figured having some benchmark numbers would be a good idea.
Now, with parrot I've been shooting for an overall 20% faster than perl 5. Nothing fancy, nothing revolutionary, just a good solid chunk better. 20% faster seems achievable, and I'd consider it a success if we did that. 30% faster and I'd be thrilled. So I ran our MOPS benchmark.
MOPS is a stupid benchmark--all it does is count from 1 to 100 Million. It was originally designed to do really simple things so we could judge opcode dispatch speed. We've versions for a bunch of languages. We've even got a postscript version.
Running this for perl takes 479 seconds. Not bad--we are going to 100 million after all. (This is on my old 300MHz Celeron box)
I take a shot at running it for parrot. We've three versions of it, just because. The trivial version, with the JIT enabled, takes all of 2 seconds to run, but that's hardly a fair comparison with perl, as it's all integer math. (Real machine ints no less, not even integer PMCs)
Running the truly equivalent version takes... 125 seconds.
But that's not all. Parrot, by default, builds with -g and no -O of any kind. (We are, after all, pre-alpha) Just for chuckles, I rebuild it with -O3 (which turns on pretty much all of GCC's optimizations)
With -O3? The run takes 103 seconds. Almost 20% faster than the original, and more than 4.5 times faster than perl 5.
Add in a trivial optimization (adding the integer constant one, not a variable with the value 1) and the run drops down to 80 seconds.
I think I'm not going to worry quite so much about hitting my 20% faster mark. :)
How does the equivalent in Ruby do?
Re:out of curiosity
Elian on 2002-03-13T16:26:16
Good question. Unfortunately I don't have a ruby interpreter on my test box at the moment, so I can't get exactly comparable results.A quick run on the iBook here gets me:
perl: 193 sec
Ruby: 255 sec
Slowest Parrot: 26.7 sec
Fastest Parrot: 6.7 secSo we're looking pretty good there. (That's all with no JIT, as there isn't one for the PPC yet)
Re:Will Parrot be added to the shootout?
acme on 2002-03-13T09:30:54
I've considered doing this, but we can't do it just yet as most of the shootout examples need a couple more ops to be added to Parrot. We know all benchmarks suck, but this is a relatively popular one so we might as well give it a try. Oh, and the test harness for the shootout isn't the clearest piece of code I've seen...Re:Will Parrot be added to the shootout?
Elian on 2002-03-13T16:09:40
When we've got sufficient code in to do a reasonable percentage of the shootout code, yes we will.