I figured out what was wrong with the factorial test of YARV in my last post. I was only running 1,000 iterations of the factorial method. If I bump it up to 10,000,000 iterations, I get much better results:
$ time ruby fact.rb > /dev/null
real 2m42.446s
user 2m12.000s
sys 0m0.336s
$ time ruby-yarv fact.rb > /dev/null
real 1m19.009s
user 1m12.217s
sys 0m0.148s
This time around I get a 2x improvement. much closer to what I was looking for. 1,000 iterations wasn't enough to offset the startup and compilation time. I wonder what kind of times I'd see if I could dump the compiled byte-code?
No comments:
Post a Comment