]> Cypherpunks repositories - gostls13.git/commitdiff
test/bench: move to test/bench/shootout
authorRuss Cox <rsc@golang.org>
Tue, 13 Dec 2011 22:46:54 +0000 (17:46 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 13 Dec 2011 22:46:54 +0000 (17:46 -0500)
R=golang-dev, r, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5487067

53 files changed:
src/run.bash
test/bench/shootout/Makefile [moved from test/bench/Makefile with 100% similarity]
test/bench/shootout/binary-tree-freelist.go [moved from test/bench/binary-tree-freelist.go with 100% similarity]
test/bench/shootout/binary-tree-freelist.txt [moved from test/bench/binary-tree-freelist.txt with 100% similarity]
test/bench/shootout/binary-tree.c [moved from test/bench/binary-tree.c with 100% similarity]
test/bench/shootout/binary-tree.go [moved from test/bench/binary-tree.go with 100% similarity]
test/bench/shootout/binary-tree.txt [moved from test/bench/binary-tree.txt with 100% similarity]
test/bench/shootout/chameneosredux.c [moved from test/bench/chameneosredux.c with 100% similarity]
test/bench/shootout/chameneosredux.go [moved from test/bench/chameneosredux.go with 95% similarity]
test/bench/shootout/chameneosredux.txt [moved from test/bench/chameneosredux.txt with 100% similarity]
test/bench/shootout/fannkuch-parallel.go [moved from test/bench/fannkuch-parallel.go with 100% similarity]
test/bench/shootout/fannkuch-parallel.txt [moved from test/bench/fannkuch-parallel.txt with 100% similarity]
test/bench/shootout/fannkuch.c [moved from test/bench/fannkuch.c with 100% similarity]
test/bench/shootout/fannkuch.go [moved from test/bench/fannkuch.go with 100% similarity]
test/bench/shootout/fannkuch.txt [moved from test/bench/fannkuch.txt with 100% similarity]
test/bench/shootout/fasta-1000.out [moved from test/bench/fasta-1000.out with 100% similarity]
test/bench/shootout/fasta.c [moved from test/bench/fasta.c with 100% similarity]
test/bench/shootout/fasta.go [moved from test/bench/fasta.go with 99% similarity]
test/bench/shootout/fasta.txt [moved from test/bench/fasta.txt with 100% similarity]
test/bench/shootout/k-nucleotide-parallel.go [moved from test/bench/k-nucleotide-parallel.go with 100% similarity]
test/bench/shootout/k-nucleotide-parallel.txt [moved from test/bench/k-nucleotide-parallel.txt with 100% similarity]
test/bench/shootout/k-nucleotide.c [moved from test/bench/k-nucleotide.c with 100% similarity]
test/bench/shootout/k-nucleotide.go [moved from test/bench/k-nucleotide.go with 100% similarity]
test/bench/shootout/k-nucleotide.txt [moved from test/bench/k-nucleotide.txt with 100% similarity]
test/bench/shootout/mandelbrot.c [moved from test/bench/mandelbrot.c with 100% similarity]
test/bench/shootout/mandelbrot.go [moved from test/bench/mandelbrot.go with 100% similarity]
test/bench/shootout/mandelbrot.txt [moved from test/bench/mandelbrot.txt with 100% similarity]
test/bench/shootout/meteor-contest.c [moved from test/bench/meteor-contest.c with 100% similarity]
test/bench/shootout/meteor-contest.go [moved from test/bench/meteor-contest.go with 99% similarity]
test/bench/shootout/meteor-contest.txt [moved from test/bench/meteor-contest.txt with 100% similarity]
test/bench/shootout/nbody.c [moved from test/bench/nbody.c with 100% similarity]
test/bench/shootout/nbody.go [moved from test/bench/nbody.go with 80% similarity]
test/bench/shootout/nbody.txt [moved from test/bench/nbody.txt with 100% similarity]
test/bench/shootout/pidigits.c [moved from test/bench/pidigits.c with 100% similarity]
test/bench/shootout/pidigits.go [moved from test/bench/pidigits.go with 100% similarity]
test/bench/shootout/pidigits.txt [moved from test/bench/pidigits.txt with 100% similarity]
test/bench/shootout/regex-dna-parallel.go [moved from test/bench/regex-dna-parallel.go with 100% similarity]
test/bench/shootout/regex-dna-parallel.txt [moved from test/bench/regex-dna-parallel.txt with 100% similarity]
test/bench/shootout/regex-dna.c [moved from test/bench/regex-dna.c with 100% similarity]
test/bench/shootout/regex-dna.go [moved from test/bench/regex-dna.go with 100% similarity]
test/bench/shootout/regex-dna.txt [moved from test/bench/regex-dna.txt with 100% similarity]
test/bench/shootout/reverse-complement.c [moved from test/bench/reverse-complement.c with 100% similarity]
test/bench/shootout/reverse-complement.go [moved from test/bench/reverse-complement.go with 100% similarity]
test/bench/shootout/reverse-complement.txt [moved from test/bench/reverse-complement.txt with 100% similarity]
test/bench/shootout/spectral-norm-parallel.go [moved from test/bench/spectral-norm-parallel.go with 100% similarity]
test/bench/shootout/spectral-norm.c [moved from test/bench/spectral-norm.c with 100% similarity]
test/bench/shootout/spectral-norm.go [moved from test/bench/spectral-norm.go with 100% similarity]
test/bench/shootout/spectral-norm.txt [moved from test/bench/spectral-norm.txt with 100% similarity]
test/bench/shootout/threadring.c [moved from test/bench/threadring.c with 100% similarity]
test/bench/shootout/threadring.go [moved from test/bench/threadring.go with 99% similarity]
test/bench/shootout/threadring.txt [moved from test/bench/threadring.txt with 100% similarity]
test/bench/shootout/timing.log [moved from test/bench/timing.log with 100% similarity]
test/bench/shootout/timing.sh [moved from test/bench/timing.sh with 100% similarity]

index 64514bce62d90dc3ec223a579fd05cc52bc22e45..5e27fc24f8349525593a1d54eae6a37e6db67944 100755 (executable)
@@ -101,7 +101,7 @@ do
 done
 
 [ "$GOARCH" == arm ] ||
-(xcd ../test/bench
+(xcd ../test/bench/shootout
 ./timing.sh -test
 ) || exit $?
 
similarity index 95%
rename from test/bench/chameneosredux.go
rename to test/bench/shootout/chameneosredux.go
index 2cb1440041f5cc29f94940a8aff3d247e4d65b6d..3395798620f060589ab3afefcfb5c11351991b30 100644 (file)
@@ -49,20 +49,20 @@ const (
 )
 
 var complement = [...]int{
-       red | red<<2: red,
-       red | yellow<<2: blue,
-       red | blue<<2: yellow,
-       yellow | red<<2: blue,
+       red | red<<2:       red,
+       red | yellow<<2:    blue,
+       red | blue<<2:      yellow,
+       yellow | red<<2:    blue,
        yellow | yellow<<2: yellow,
-       yellow | blue<<2: red,
-       blue | red<<2: yellow,
-       blue | yellow<<2: red,
-       blue | blue<<2: blue,
+       yellow | blue<<2:   red,
+       blue | red<<2:      yellow,
+       blue | yellow<<2:   red,
+       blue | blue<<2:     blue,
 }
 
 var colname = [...]string{
-       blue: "blue",
-       red: "red",
+       blue:   "blue",
+       red:    "red",
        yellow: "yellow",
 }
 
similarity index 99%
rename from test/bench/fasta.go
rename to test/bench/shootout/fasta.go
index d13edd5dcfa039fc3cc7bf0ef7c843a578c3f220..17ff5dae55da47bed7e548427155a9b7d1558299 100644 (file)
@@ -70,7 +70,7 @@ const (
        IA = 3877
        IC = 29573
 
-       LookupSize  = 4096
+       LookupSize          = 4096
        LookupScale float64 = LookupSize - 1
 )
 
@@ -178,7 +178,6 @@ func main() {
        Random(homosapiens, 5**n)
 }
 
-
 type buffer []byte
 
 func (b *buffer) Flush() {
similarity index 99%
rename from test/bench/meteor-contest.go
rename to test/bench/shootout/meteor-contest.go
index 6660810ebd048597cb038a459085b6590ae2878b..34a4e23f97b0a48577f42e81c2d6be5f67cc626d 100644 (file)
@@ -43,7 +43,6 @@ import (
 
 var max_solutions = flag.Int("n", 2100, "maximum number of solutions")
 
-
 func boolInt(b bool) int8 {
        if b {
                return 1
@@ -115,7 +114,6 @@ var piece_def = [10][4]int8{
        [4]int8{E, E, E, SW},
 }
 
-
 /* To minimize the amount of work done in the recursive solve function below,
  * I'm going to allocate enough space for all legal rotations of each piece
  * at each position on the board. That's 10 pieces x 50 board positions x
@@ -138,7 +136,6 @@ func rotate(dir int8) int8 { return (dir + 2) % PIVOT }
 /* Returns the direction flipped on the horizontal axis */
 func flip(dir int8) int8 { return (PIVOT - dir) % PIVOT }
 
-
 /* Returns the new cell index from the specified cell in the
  * specified direction.  The index is only valid if the
  * starting cell and direction have been checked by the
@@ -322,7 +319,6 @@ func record_piece(piece int, minimum int8, first_empty int8, piece_mask uint64)
        piece_counts[piece][minimum]++
 }
 
-
 /* Fill the entire board going cell by cell.  If any cells are "trapped"
  * they will be left alone.
  */
@@ -351,7 +347,6 @@ func fill_contiguous_space(board []int8, index int8) {
        }
 }
 
-
 /* To thin the number of pieces, I calculate if any of them trap any empty
  * cells at the edges.  There are only a handful of exceptions where the
  * the board can be solved with the trapped cells.  For example:  piece 8 can
@@ -382,7 +377,6 @@ func has_island(cell []int8, piece int) bool {
        return true
 }
 
-
 /* Calculate all six rotations of the specified piece at the specified index.
  * We calculate only half of piece 3's rotations.  This is because any solution
  * found has an identical solution rotated 180 degrees.  Thus we can reduce the
@@ -417,7 +411,6 @@ func calc_pieces() {
        }
 }
 
-
 /* Calculate all 32 possible states for a 5-bit row and all rows that will
  * create islands that follow any of the 32 possible rows.  These pre-
  * calculated 5-bit rows will be used to find islands in a partially solved
@@ -530,7 +523,6 @@ func calc_rows() {
        }
 }
 
-
 /* Calculate islands while solving the board.
  */
 func boardHasIslands(cell int8) int8 {
@@ -545,7 +537,6 @@ func boardHasIslands(cell int8) int8 {
        return bad_even_triple[current_triple]
 }
 
-
 /* The recursive solve algorithm.  Try to place each permutation in the upper-
  * leftmost empty cell.  Mark off available pieces as it goes along.
  * Because the board is a bit mask, the piece number and bit mask must be saved
similarity index 80%
rename from test/bench/nbody.go
rename to test/bench/shootout/nbody.go
index e9f4517e8e7b74d17f9f210d1a1ac7e850368934..988f3ba9cc06cd0b6e60396df6d68796175841cd 100644 (file)
@@ -125,39 +125,39 @@ func (sys System) advance(dt float64) {
 
 var (
        jupiter = Body{
-               x: 4.84143144246472090e+00,
-               y: -1.16032004402742839e+00,
-               z: -1.03622044471123109e-01,
-               vx: 1.66007664274403694e-03 * daysPerYear,
-               vy: 7.69901118419740425e-03 * daysPerYear,
-               vz: -6.90460016972063023e-05 * daysPerYear,
+               x:    4.84143144246472090e+00,
+               y:    -1.16032004402742839e+00,
+               z:    -1.03622044471123109e-01,
+               vx:   1.66007664274403694e-03 * daysPerYear,
+               vy:   7.69901118419740425e-03 * daysPerYear,
+               vz:   -6.90460016972063023e-05 * daysPerYear,
                mass: 9.54791938424326609e-04 * solarMass,
        }
        saturn = Body{
-               x: 8.34336671824457987e+00,
-               y: 4.12479856412430479e+00,
-               z: -4.03523417114321381e-01,
-               vx: -2.76742510726862411e-03 * daysPerYear,
-               vy: 4.99852801234917238e-03 * daysPerYear,
-               vz: 2.30417297573763929e-05 * daysPerYear,
+               x:    8.34336671824457987e+00,
+               y:    4.12479856412430479e+00,
+               z:    -4.03523417114321381e-01,
+               vx:   -2.76742510726862411e-03 * daysPerYear,
+               vy:   4.99852801234917238e-03 * daysPerYear,
+               vz:   2.30417297573763929e-05 * daysPerYear,
                mass: 2.85885980666130812e-04 * solarMass,
        }
        uranus = Body{
-               x: 1.28943695621391310e+01,
-               y: -1.51111514016986312e+01,
-               z: -2.23307578892655734e-01,
-               vx: 2.96460137564761618e-03 * daysPerYear,
-               vy: 2.37847173959480950e-03 * daysPerYear,
-               vz: -2.96589568540237556e-05 * daysPerYear,
+               x:    1.28943695621391310e+01,
+               y:    -1.51111514016986312e+01,
+               z:    -2.23307578892655734e-01,
+               vx:   2.96460137564761618e-03 * daysPerYear,
+               vy:   2.37847173959480950e-03 * daysPerYear,
+               vz:   -2.96589568540237556e-05 * daysPerYear,
                mass: 4.36624404335156298e-05 * solarMass,
        }
        neptune = Body{
-               x: 1.53796971148509165e+01,
-               y: -2.59193146099879641e+01,
-               z: 1.79258772950371181e-01,
-               vx: 2.68067772490389322e-03 * daysPerYear,
-               vy: 1.62824170038242295e-03 * daysPerYear,
-               vz: -9.51592254519715870e-05 * daysPerYear,
+               x:    1.53796971148509165e+01,
+               y:    -2.59193146099879641e+01,
+               z:    1.79258772950371181e-01,
+               vx:   2.68067772490389322e-03 * daysPerYear,
+               vy:   1.62824170038242295e-03 * daysPerYear,
+               vz:   -9.51592254519715870e-05 * daysPerYear,
                mass: 5.15138902046611451e-05 * solarMass,
        }
        sun = Body{
similarity index 100%
rename from test/bench/regex-dna-parallel.go
rename to test/bench/shootout/regex-dna-parallel.go
index 1335e4d34fdf11b41032c413a9284d3a15cd42b6..9c6d42101d968a811d1840300dc9ef8d37466fac 100644 (file)
@@ -39,8 +39,8 @@ import (
        "fmt"
        "io/ioutil"
        "os"
-       "runtime"
        "regexp"
+       "runtime"
 )
 
 var variants = []string{
similarity index 99%
rename from test/bench/threadring.go
rename to test/bench/shootout/threadring.go
index 031908a20f60c0c675e5ca4e0fbb6dedcfe7ab7a..e76dd0b452decdc25b359015197eb328cc6d589f 100644 (file)
@@ -52,7 +52,7 @@ func f(i int, in <-chan int, out chan<- int) {
                        fmt.Printf("%d\n", i)
                        os.Exit(0)
                }
-               out <- n-1
+               out <- n - 1
        }
 }