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:
parent
552a556a40
commit
276473cd72
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user