1package plist 2 3import ( 4 "reflect" 5 "testing" 6 "time" 7) 8 9func BenchmarkStructUnmarshal(b *testing.B) { 10 type Data struct { 11 Intarray []uint64 `plist:"intarray"` 12 Floats []float64 `plist:"floats"` 13 Booleans []bool `plist:"booleans"` 14 Strings []string `plist:"strings"` 15 Dat []byte `plist:"data"` 16 Date time.Time `plist:"date"` 17 } 18 b.ResetTimer() 19 for i := 0; i < b.N; i++ { 20 var xval Data 21 d := &Decoder{} 22 d.unmarshal(plistValueTree, reflect.ValueOf(&xval)) 23 } 24} 25 26func BenchmarkInterfaceUnmarshal(b *testing.B) { 27 for i := 0; i < b.N; i++ { 28 var xval interface{} 29 d := &Decoder{} 30 d.unmarshal(plistValueTree, reflect.ValueOf(&xval)) 31 } 32} 33