Issue Details (XML | Word | Printable)

Key: JRUBY-2230
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Charles Oliver Nutter
Reporter: Michael Galpin
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

Compiler emits exception-handling sections of code that can be reached through non-exceptional paths.

Created: 05/Mar/08 04:22 PM   Updated: 25/Jul/08 03:48 PM   Resolved: 23/May/08 09:15 AM
Return to search
Component/s: Compiler
Affects Version/s: JRuby 1.1RC2
Fix Version/s: JRuby 1.1.2

Time Tracking:
Not Specified

File Attachments: 1. File triangle.rb (1 kB)

Environment: Windows 2003, x64


 Description  « Hide

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.



Charles Oliver Nutter added a comment - 01/May/08 07:48 PM

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.


Charles Oliver Nutter made changes - 01/May/08 07:48 PM
Field Original Value New Value
Priority Major [ 3 ] Critical [ 2 ]
Fix Version/s JRuby 1.1.2 [ 14210 ]
Component/s Performance [ 13077 ]
Component/s Compiler [ 12228 ]
Charles Oliver Nutter added a comment - 01/May/08 07:49 PM

Updating bug title to reflect the actual problem.


Charles Oliver Nutter made changes - 01/May/08 07:49 PM
Summary Performance Issue? Compiler emits exception-handling sections of code that can be reached through non-exceptional paths.
Charles Oliver Nutter added a comment - 23/May/08 09:15 AM

I don't have a good way to test performance on J9, but the same issue was causing a crash on some versions of HotSpot and now no longer is. So I'm optimistically marking this resolved...if there are still performance issues, and you can confirm they're the same problem, reopen. Otherwise report new issues.


Charles Oliver Nutter made changes - 23/May/08 09:15 AM
Assignee Charles Oliver Nutter [ headius ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Charles Oliver Nutter made changes - 04/Jul/08 09:07 AM
Status Resolved [ 5 ] Closed [ 6 ]
Michael Galpin added a comment - 25/Jul/08 03:48 PM

I confirmed the bug fix on the J9 JVM. JRuby on J9 now handily outperforms CRuby for the algorithm included in the bug. I put some more details on my blog: http://fupeg.blogspot.com/2008/07/jruby-113-performance.html