Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6603011
Votes 0
Synopsis RFE: Optimize long division
Category hotspot:compiler2
Reported Against
Release Fixed hs13(b01), 6u14(b01) (Bug ID:2174884) , 7(b27) (Bug ID:2177118)
State 10-Fix Delivered, request for enhancement
Priority: 3-Medium
Related Bugs 6732154 , 6837849
Submit Date 10-SEP-2007
Description
Derby benchmark inside SPECjvm2007 has some hot code path like below:

private int getTimeIndex(long time) {
            int res1 = 0;
            long tmp = time;
            for (int i = 0; i < 20; i ++) {
                res1 += tmp % 10;
                tmp = tmp / 10;
            }
            return (int)(res1 % 15);
        }

collector and analyzer show about it takes  4.54% of user CPU time on Solaris x86. The current c2 compiler only optimizes the integer division, but not for the long division case according to Vladimir. This partially explains why we have 3 times division instruction than some of our competitors.
Posted Date : 2007-09-10 23:42:46.0
Work Around
N/A
Evaluation
Rework the div by constant code in divnode.cpp to support longs as well as
to consistent across longs and ints.
Posted Date : 2008-03-14 15:46:56.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang