diff --git a/test/bench/go1/fasta_test.go b/test/bench/go1/fasta_test.go index dcb2d1055d9..bff056fa90c 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 9256164d76f..6b6c1e5772b 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) } }