1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-15 22:50:24 +02:00

remove structFieldDecoder

This commit is contained in:
Tao Wen
2016-12-08 08:26:57 +08:00
parent 3e376c671c
commit 78f273a512
2 changed files with 80 additions and 49 deletions

View File

@ -276,21 +276,18 @@ func Test_reflect_nested(t *testing.T) {
type StructOfTagOne struct {
field1 string `json:"field1"`
field2 string `json:"field2"`
field3 int `json:"field3,string"`
field4 int `json:"field4,string"`
}
func Benchmark_jsoniter_reflect(b *testing.B) {
b.ReportAllocs()
for n := 0; n < b.N; n++ {
//iter := ParseString(`{"field3": "100"}`)
//struct_ := StructOfTagOne{}
//iter.Read(&struct_)
iter := ParseString(`[1,2,3]`)
var array []int
iter.Read(&array)
iter := ParseString(`{"field3": "100"}`)
struct_ := StructOfTagOne{}
iter.Read(&struct_)
//iter := ParseString(`[1,2,3]`)
//var array []int
//iter.Read(&array)
}
}