Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1RC2
-
Fix Version/s: JRuby 1.1.2
-
Component/s: Compiler
-
Labels:None
-
Environment:Windows 2003, x64
-
Number of attachments :
Description
JRuby underperformed Ruby for a mathematical oriented algorithm. The script is attached to the bug.
This was running using IBM's J9 JVM:
$ java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pwi32devifx-20070531a (SR4 + IY99287 + IY99356 + IY98136))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows Server 2003 x86-32 j9vmwi3223ifx-20070525 (JIT enabled)
J9VM - 20070524_12771_lHdSMR
JIT - 20070109_1805ifx1_r8
GC - WASIFIX_2007)
JCL - 20070131
Running the same test with the 64-bit HotSpot JVMs showed JRuby was faster than Ruby.
This is likely due to an issue in the compiler that also causes the HotSpot C1 compiler to avoid compilation. The issue is that most of our compiled exception handling allows normal execution to fall through into exception-handling blocks. This case is not ever emitted by javac, and as such almost all JITs avoid compiling it in bytecode, leaving the code to interpret.
It is unknown whether this affects the HotSpot C2, compiler, but this is a critical performance issue for 1.1.2 since there are now two different JVM versions that we know downgrade optimization for these cases.