Well, with the new versions of JRuby out, I figured it was time to fire up my LogWatchR benchmarks again. For this test I run 20 minutes worth of syslog entries from the system I work on through a log analysis tool I built in Ruby. There are about 75,000 syslog entries in there, so there’s a reasonable amount of IO to be done, not to mention a lot of regexp pattern matching to find potential events, and a bunch of object creation (a new object for each event that’s found). All in all, it’s a pretty good workout for Ruby.
First the boring news. When I tested JRuby 1.0.2, I found that it performed almost identically with 1.0.1. Over multiple runs, sometimes one would be faster, and other times it would be slower.
Things got a bit more interesting when I tested 1.1b1 against previous versions of JRuby. Here are some sample results:
|Version||Average Run Time||Standard Deviation|
|Jruby 1.0.2||19.61 Secs||0.26 Secs|
|JRuby 1.1b1||17.03 Secs||0.26 Secs|
So it looks like 1.1b1 is about 13% faster than 1.0.2 and 1.0.1, but the story doesn’t stop there. It turns out that regexps are still one of the chokepoints for performance in JRuby. (See also Charles Nutter’s comments.) So if a regexp heavy application is already seeing a 13% speed increase, and the JRuby team is working on improving things for the 1.1 final release, the future looks bright indeed.
Note: for those of you looking for JRuby vs Ruby performance numbers, I’ll post something soon after the final 1.1 release hits the street.
If you enjoyed this article on profiling, you might also want to look at these: