Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Not A Bug
-
Affects Version/s: JRuby 1.6.5
-
Fix Version/s: None
-
Component/s: Performance
-
Labels:None
-
Environment:Mac OSX 10.6.x
-
Number of attachments :
Description
I wrote a short benchmark to see if the order of variables and Constants mattered when doing a comparison. It showed that JRuby gets quite slow as a boolean OR expression gets longer which indicates the #== could use a little help. The benchmark and results are enclosed. I compared it to RBX which, while quite a bit slower, doesn't show the steep performance drop-off as the expression gets longer like JRuby does.
Yes, I'm looking for perfection. ![]()
After all, this is merely comparing a few integers for cryin' out loud. This should be near native speed (in my dreams).
Actually your benchmark measures the cost of us not inlining super. I suspect rbx is inlining the super so the cost of additional compares is much less severe. If you remove the super our numbers get much much lower (screws up first two tests since we don't find). Note that Ruby 1.9.3 is very very similar behavior to us (I suspect for the same reason). In theory, IR will solve this problem since we will be able to inline the super.