Anyway..for a trimmed down profiling session I just used this main method on JRE1.6.0_26-b03 -server:
ScriptingContainer c = new ScriptingContainer();
c.setCompatVersion(CompatVersion.RUBY1_8);
c.setObjectSpaceEnabled(false);
// c.setCompileMode(CompileMode.OFF); // experimented with this
c.runScriptlet("puts 'Hello'");
In my environment, this method takes 4.1s and 7.7s with 1.5.6 and 1.7.9 respectively.
According to YourKit, it's due mostly due to org.jruby.Ruby.init() slowdown 3.1s -> 6.2s.
It seems to be the LoadService is doing much more now - eg, LoadService.require() is invoked 20 times now (up from 2), and takes 5x more time (0.5s to 2.5s). In my production code, I have a lot more require()s of course and a lot of class lookups, I'm wondering if they are impacted even more..anyway, this 2x overall slowdown seems to be the same in the real life context too.
Yes, it's still 1.8 mode - I have to keep it like that I'm afraid due to external dependencies..Anyway 1.9 mode seems even slower (around 2-3x slowdown).