Aleksey, you are right. I did the transformation manually and tested again. The result is 259936 msec, which is improved more than 42%. Following are about the manual
transformation. Original: return 1.0/((i+j)*(i+j+1)/2 +i+1); Transformed: return 1.0/((((i+j)*(i+j+1)+(1&(((i+j)*(i+j+1))>>31))) >> 1) +i+1); In my opinion, the replacement does the same thing in JIT. I'll check about the cause of the difference. Thanks for your suggestions. Xiaoming On Tue, Aug 5, 2008 at 3:11 PM, Aleksey Shipilev <[EMAIL PROTECTED] > wrote: > On Tue, Aug 5, 2008 at 8:03 AM, xiaoming gu <[EMAIL PROTECTED]> wrote: > > Hi, guys. The patch for harmony-5901 is ready. > At last! Thanks, Xioaming! > > > I compared the performance for all the 5 benchmarks in "Java vs. C > > benchmark" by Stefan Krause on my desktop > > workstation (Intel Core 2 Quad [EMAIL PROTECTED], 3.23G RAM, Windows XP > SP2). > > With MUL/DIV replaced by shift, > > spectralnorm is improved more than 29% (from 450258 msec to 319578 msec) > Can you spend some time and measure how much boost there is, in case > your _manual_ change of MUL/DIV operations to shifts? I had measured > +60% boost, so it would be great to conclude whether yours +30% is > connected with patch overheads (handling negative operands, I guess) > or your environment. > > Thanks, > Aleksey. >
