Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.1
-
Fix Version/s: JRuby 1.1.2
-
Component/s: Performance
-
Labels:None
-
Number of attachments :
Description
In order to fix JRUBY-2477, some overhead was adding to the caching process in InlineCachingCallSite. As a result, polymorphic calls (which get no benefit from our monomorphic inline cache) have taken a 13% performance hit. We need to remedy this, either by implementing a polymorphic inline cache or by disabling inline caching (eliminating cache churn) when a call site is found to be polymorphic.
Fixed in 6759 with a benchmark added in 6757. I fixed it for now by adding a "misses" counter to InlineCachingCallSite. The counter is incremented for every time a new method must be cached. If it reaches 50 (arbitrarily chosen by me) it will no longer attempt to cache methods. For smaller, cheaper methods, the improvement is substantial:
Before:
After:
I will investigate the slight degradation in monomorphic dispatch, but for now it appears to be only noise.