1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-21 23:07:33 +02:00

optimize read float

This commit is contained in:
Tao Wen
2016-12-06 10:21:47 +08:00
parent 3e160d6f5d
commit 688f2968dd
2 changed files with 31 additions and 30 deletions

View File

@ -21,6 +21,14 @@ func Test_float64_1_dot_1(t *testing.T) {
}
}
func Test_float32_1_dot_1_comma(t *testing.T) {
iter := ParseString(`1.1,`)
val := iter.ReadFloat32()
if val != 1.1 {
t.Fatal(val)
}
}
func Benchmark_jsoniter_float(b *testing.B) {
for n := 0; n < b.N; n++ {
iter := ParseString(`1.1`)