1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:17:56 -07:00

strconv: add Ftoa benchmarks

R=bradfitz
CC=golang-dev
https://golang.org/cl/5373096
This commit is contained in:
Russ Cox 2011-11-15 11:02:04 -05:00
parent 552a556a40
commit 276473cd72

View File

@ -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)
}
}