From: <bc...@wo...> - 2001-01-13 12:35:33
|
On Fri, 12 Jan 2001 22:20:52 -0800 (PST), you wrote: >Why is math sooooooooo slow on HP versus Linux?? For the example below >I calculate the time to calculate 2L**10000 on HP and Linux. It's over >2,000 faster on a Linux PC (512 MHz dual Celeron) than on a HP (K box, >4 processor, 180 MHz). > >This particular example is not critical to my application. I just >focus on it because of the dramatic difference in performance on HP >versus other platforms. Might this be a clue as to a problem with HP?? > > >HP: > >JPython 1.1+09 on java1.2.2.05 (JIT: null) >86.5 <-- interpretted, very slow > >JPython 1.1+09 on java1.2.2.05 (JIT: HP) >11.8 <-- classic JIT > >JPython 1.1+09 on java1.2.2.05 (JIT: null) >14.9 <-- HotSpot JIT My numbers are on Win2k & JDK1.3 & 300Mhz P3: Jython 2.0beta2 on java1.3.0 (JIT: null) 37.74500000476837 <-- interpretted Jython 2.0beta2 on java1.3.0 (JIT: null) 4.736999988555908 <-- hotspot While somewhat faster then your HP it is in the within the same range. >Linux 512 MHz dual Celeron (brain dead?) Pentium > > Linux: /home/mudd[1] jpython >JPython 1.1 on java1.2.2-RC2 (JIT: javacomp) >Copyright (C) 1997-1999 Corporation for National Research Initiatives >>>> from time import time >>>> t1=time(); x=2L**10000; delay=time()-t1; print delay >0.00499 <-- About 2,400 times faster than HP's best numbers??!? >>>> That's fast! Does it actually calculate the correct value? The power calculation is done fully by the java.math.BigInteger implementation. The BigInteger.pow() on JDK1.3 (and HP too I expect) is implemented in java as some kind of loop which I don't understand. If the linux JVM are doing its BigInteger stuff in native code, that might explain the difference. regards, finn |