From: Russ Cox Date: Tue, 15 Nov 2011 16:02:04 +0000 (-0500) Subject: strconv: add Ftoa benchmarks X-Git-Tag: weekly.2011-11-18~53 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=276473cd72d47c5566f1dafeee6c45ff688cac74;p=gostls13.git strconv: add Ftoa benchmarks R=bradfitz CC=golang-dev https://golang.org/cl/5373096 --- diff --git a/src/pkg/strconv/ftoa_test.go b/src/pkg/strconv/ftoa_test.go index 6d361a138e..8bac5da452 100644 --- a/src/pkg/strconv/ftoa_test.go +++ b/src/pkg/strconv/ftoa_test.go @@ -148,3 +148,27 @@ func TestFtoa(t *testing.T) { } } } + +func BenchmarkFtoa64Decimal(b *testing.B) { + for i := 0; i < b.N; i++ { + Ftoa64(33909, 'g', -1) + } +} + +func BenchmarkFtoa64Float(b *testing.B) { + for i := 0; i < b.N; i++ { + Ftoa64(339.7784, 'g', -1) + } +} + +func BenchmarkFtoa64FloatExp(b *testing.B) { + for i := 0; i < b.N; i++ { + Ftoa64(-5.09e75, 'g', -1) + } +} + +func BenchmarkFtoa64Big(b *testing.B) { + for i := 0; i < b.N; i++ { + Ftoa64(123456789123456789123456789, 'g', -1) + } +}