]> Cypherpunks repositories - gostls13.git/commitdiff
timing updates after 6g change for efficient division by powers of two
authorRob Pike <r@golang.org>
Fri, 7 Aug 2009 17:39:45 +0000 (10:39 -0700)
committerRob Pike <r@golang.org>
Fri, 7 Aug 2009 17:39:45 +0000 (10:39 -0700)
R=rsc
DELTA=25  (23 added, 0 deleted, 2 changed)
OCL=32873
CL=32875

test/bench/spectral-norm-parallel.go
test/bench/timing.log
test/bench/timing.sh

index 9e7f33885f7cbf941b05d2fe7cbffac3d8c5956c..68aaedea661266074b30970b49ceb587e6414de1 100644 (file)
@@ -47,7 +47,7 @@ var n = flag.Int("n", 2000, "count")
 var nCPU = flag.Int("ncpu", 4, "number of cpus")
 
 func evalA(i, j int) float64 {
-       return 1 / float64(((i + j)*(i + j + 1)>>1+ i + 1));
+       return 1 / float64(((i + j)*(i + j + 1)/2 + i + 1));
 }
 
 type Vec []float64
index 43293665d52d3d050fa995ef4a5835db7093b762..8fbf43a444ed4d0e7a67d15683778960cea1230b 100644 (file)
@@ -92,3 +92,26 @@ pidigits 10000
        gc pidigits     77.69u 0.14s 78.18r
        gc_B pidigits   74.26u 0.18s 75.41r
        gc_B pidigits   68.48u 0.20s 69.31r   # special case: no bounds checking in bignum
+
+August 7 2009
+
+# New gc does better division by powers of 2.  Significant improvements:
+
+spectral-norm 5500
+       gcc -O2 spectral-norm.c -lm     11.50u 0.00s 11.50r
+       gccgo -O2 spectral-norm.go      12.02u 0.00s 12.02r
+       gc spectral-norm        23.98u 0.00s 24.00r     # new time is 0.48 times old time, 52% faster
+       gc_B spectral-norm      23.71u 0.01s 23.72r     # ditto
+       gc spectral-norm-parallel       24.04u 0.00s 6.26r  # /2 put back.  note: 4x faster (on r70, idle)
+
+k-nucleotide 1000000
+       gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0   10.82u 0.04s 10.87r
+       gccgo -O2 k-nucleotide.go       22.73u 0.89s 23.63r
+       gc k-nucleotide 15.97u 0.03s 16.04r
+       gc_B k-nucleotide       15.86u 0.06s 15.93r     # 8.5% faster, but probably due to weird cache effeccts in previous version
+
+pidigits 10000
+       gcc -O2 pidigits.c -lgmp        2.58u 0.00s 2.58r
+       gc pidigits     71.24u 0.04s 71.28r     # 8.5% faster
+       gc_B pidigits   71.25u 0.03s 71.29r     # 4% faster
+
index a8cc9e0039509bacb8fef251518d3e584b9e1fe8..233e381c62efeac0c62cca38aac04402ac4ed3b9 100755 (executable)
@@ -121,7 +121,7 @@ pidigits() {
 
 case $# in
 0)
-       run="fasta revcom nbody binarytree fannkuch regexdna spectralnorm knucleotide mandelbrot meteor pidigits"
+       run="fasta revcomp nbody binarytree fannkuch regexdna spectralnorm knucleotide mandelbrot meteor pidigits"
        ;;
 *)
        run=$*