Is java7 faster than java6?

 

There was recent discussion about Java7 performance for numerical calculations. Few people saw some 20-40% improvement for java7, compare to Java6. This simple script which can be executed in jhepwork shows no such improvement. Run this code above (here I'm using 2 cores) and see it yourself:

#########################################################################################################
from cern.colt.matrix        import *
from edu.emory.mathcs.utils  import ConcurrencyUtils
import time

# do some calculations on DenseDoubleMatrix2D
def process(M):
       M.cardinality()
       M.dctColumns(0)
       M.dctRows(0)
       M.dct2(0)  
       M.dht2()
       M.dhtColumns()
       M.dhtRows() 
       M.dst2(0)
       M.dstColumns(0)
       M.dstRows(0)
       M.vectorize()
       M.zSum()
       M.idct2(0)

Ncores=2
print " benchmarks of DenseDoubleMatrix2D for "+str(Ncores)+"  CPU core. Wait!"
ConcurrencyUtils.setNumberOfThreads(Ncores)
start = time.clock()
M=tdouble.DoubleFactory2D.dense.random(2000, 2000) # random matrix
process(M)
print ' Multiple CPU time (s)=',time.clock()-start

###########################################################################

Guest Blog

Guest blog

Main discussion

Discussion