diff options
author | Dave Cheney <dave@cheney.net> | 2012-06-06 07:49:58 +1000 |
---|---|---|
committer | Dave Cheney <dave@cheney.net> | 2012-06-06 07:49:58 +1000 |
commit | 166dab6993029802526804393a31cb8d080743e6 (patch) | |
tree | 033f15dc560d8492c49d38c0cf0f232456f55cd7 /test/bench | |
parent | 3a66bc415e674ed0ba2dd55ec7ef413fcac3778e (diff) | |
download | go-166dab6993029802526804393a31cb8d080743e6.tar.gz go-166dab6993029802526804393a31cb8d080743e6.zip |
test/bench/go1: reduce fasta data size for linux/arm
As discussed on golang-dev, reduce the size of the fasta
dataset to make it possible to run the go1 benchmarks on
small ARM systems.
Also, remove the 25m suffix from fasta data and Revcomp.
linux/arm: pandaboard OMAP4
BenchmarkBinaryTree17 1 70892426000 ns/op
BenchmarkFannkuch11 1 35712066000 ns/op
BenchmarkGobDecode 10 137146000 ns/op 5.60 MB/s
BenchmarkGobEncode 50 64953000 ns/op 11.82 MB/s
BenchmarkGzip 1 5675690000 ns/op 3.42 MB/s
BenchmarkGunzip 1 1207001000 ns/op 16.08 MB/s
BenchmarkJSONEncode 5 860424800 ns/op 2.26 MB/s
BenchmarkJSONDecode 1 3321839000 ns/op 0.58 MB/s
BenchmarkMandelbrot200 50 45893560 ns/op
BenchmarkRevcomp 10 135220300 ns/op 18.80 MB/s
BenchmarkTemplate 1 6385681000 ns/op 0.30 MB/s
R=rsc, minux.ma, dsymonds
CC=golang-dev
https://golang.org/cl/6278048
Diffstat (limited to 'test/bench')
-rw-r--r-- | test/bench/go1/fasta_test.go | 17 | ||||
-rw-r--r-- | test/bench/go1/revcomp_test.go | 6 |
2 files changed, 19 insertions, 4 deletions
diff --git a/test/bench/go1/fasta_test.go b/test/bench/go1/fasta_test.go index dcb2d1055d..bff056fa90 100644 --- a/test/bench/go1/fasta_test.go +++ b/test/bench/go1/fasta_test.go @@ -4,9 +4,24 @@ package go1 +import "runtime" + // Not a benchmark; input for revcomp. -var fasta25m = fasta(25e6) +var fastabytes = makefasta() + +func makefasta() []byte { + var n int = 25e6 + if runtime.GOARCH == "arm" { + // TODO(dfc) remove this limitation after precise gc. + // A value of 25e6 consumes 465mb of heap on 32bit + // platforms, which is too much for most ARM systems. + // A value of 25e5 produces a memory layout that + // confuses the gc on 32bit platforms. So 25e4 it is. + n = 25e4 + } + return fasta(n) +} func fasta(n int) []byte { out := make(fastaBuffer, 0, 11*n) diff --git a/test/bench/go1/revcomp_test.go b/test/bench/go1/revcomp_test.go index 9256164d76..6b6c1e5772 100644 --- a/test/bench/go1/revcomp_test.go +++ b/test/bench/go1/revcomp_test.go @@ -77,9 +77,9 @@ func revcomp(data []byte) { } } -func BenchmarkRevcomp25M(b *testing.B) { - b.SetBytes(int64(len(fasta25m))) +func BenchmarkRevcomp(b *testing.B) { + b.SetBytes(int64(len(fastabytes))) for i := 0; i < b.N; i++ { - revcomp(fasta25m) + revcomp(fastabytes) } } |