Skip to content

Commit 3408be0

Browse files
Dean KarnDean Karn
authored andcommitted
update Benchmarks for Go 1.7
``` benchmark old ns/op new ns/op delta BenchmarkSimpleUserDecodeStruct-8 336 312 -7.14% BenchmarkSimpleUserDecodeStructParallel-8 99.5 91.7 -7.84% BenchmarkSimpleUserEncodeStruct-8 972 902 -7.20% BenchmarkSimpleUserEncodeStructParallel-8 329 301 -8.51% BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1014 1028 +1.38% BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 294 292 -0.68% BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 4799 4770 -0.60% BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1581 1569 -0.76% BenchmarkComplexArrayDecodeStructAllTypes-8 16326 15973 -2.16% BenchmarkComplexArrayDecodeStructAllTypesParallel-8 4710 4801 +1.93% BenchmarkComplexArrayEncodeStructAllTypes-8 16303 15401 -5.53% BenchmarkComplexArrayEncodeStructAllTypesParallel-8 4979 5167 +3.78% BenchmarkComplexMapDecodeStructAllTypes-8 21998 20683 -5.98% BenchmarkComplexMapDecodeStructAllTypesParallel-8 6542 6880 +5.17% BenchmarkComplexMapEncodeStructAllTypes-8 17069 15567 -8.80% BenchmarkComplexMapEncodeStructAllTypesParallel-8 5609 5546 -1.12% BenchmarkDecodeNestedStruct-8 3366 3142 -6.65% BenchmarkDecodeNestedStructParallel-8 1096 1012 -7.66% BenchmarkEncodeNestedStruct-8 2230 2106 -5.56% BenchmarkEncodeNestedStructParallel-8 780 772 -1.03% benchmark old allocs new allocs delta BenchmarkSimpleUserDecodeStruct-8 1 1 +0.00% BenchmarkSimpleUserDecodeStructParallel-8 1 1 +0.00% BenchmarkSimpleUserEncodeStruct-8 11 11 +0.00% BenchmarkSimpleUserEncodeStructParallel-8 11 11 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1 1 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 1 1 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 46 46 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 46 46 +0.00% BenchmarkComplexArrayDecodeStructAllTypes-8 121 121 +0.00% BenchmarkComplexArrayDecodeStructAllTypesParallel-8 121 121 +0.00% BenchmarkComplexArrayEncodeStructAllTypes-8 146 146 +0.00% BenchmarkComplexArrayEncodeStructAllTypesParallel-8 146 146 +0.00% BenchmarkComplexMapDecodeStructAllTypes-8 130 130 +0.00% BenchmarkComplexMapDecodeStructAllTypesParallel-8 130 130 +0.00% BenchmarkComplexMapEncodeStructAllTypes-8 175 175 +0.00% BenchmarkComplexMapEncodeStructAllTypesParallel-8 175 175 +0.00% BenchmarkDecodeNestedStruct-8 14 14 +0.00% BenchmarkDecodeNestedStructParallel-8 14 14 +0.00% BenchmarkEncodeNestedStruct-8 16 16 +0.00% BenchmarkEncodeNestedStructParallel-8 16 16 +0.00% benchmark old bytes new bytes delta BenchmarkSimpleUserDecodeStruct-8 64 64 +0.00% BenchmarkSimpleUserDecodeStructParallel-8 64 64 +0.00% BenchmarkSimpleUserEncodeStruct-8 485 485 +0.00% BenchmarkSimpleUserEncodeStructParallel-8 485 485 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 96 96 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 96 96 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 3009 3009 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 3010 3010 +0.00% BenchmarkComplexArrayDecodeStructAllTypes-8 2257 2257 +0.00% BenchmarkComplexArrayDecodeStructAllTypesParallel-8 2257 2257 +0.00% BenchmarkComplexArrayEncodeStructAllTypes-8 7288 7289 +0.01% BenchmarkComplexArrayEncodeStructAllTypesParallel-8 7290 7289 -0.01% BenchmarkComplexMapDecodeStructAllTypes-8 5306 5307 +0.02% BenchmarkComplexMapDecodeStructAllTypesParallel-8 5308 5310 +0.04% BenchmarkComplexMapEncodeStructAllTypes-8 7100 7098 -0.03% BenchmarkComplexMapEncodeStructAllTypesParallel-8 7099 7099 +0.00% BenchmarkDecodeNestedStruct-8 384 384 +0.00% BenchmarkDecodeNestedStructParallel-8 384 384 +0.00% BenchmarkEncodeNestedStruct-8 704 704 +0.00% BenchmarkEncodeNestedStructParallel-8 704 704 +0.00% ```
1 parent 0668f67 commit 3408be0

File tree

2 files changed

+86
-92
lines changed

2 files changed

+86
-92
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -262,34 +262,34 @@ Field []*string{nil, nil, &i}
262262

263263
Benchmarks
264264
------
265-
###### Run on MacBook Pro (Retina, 15-inch, Late 2013) 2.6 GHz Intel Core i7 16 GB 1600 MHz DDR3 using Go version go1.6.3 darwin/amd64
265+
###### Run on MacBook Pro (Retina, 15-inch, Late 2013) 2.6 GHz Intel Core i7 16 GB 1600 MHz DDR3 using Go version go1.7 darwin/amd64
266266

267267
NOTE: the 1 allocation and B/op in the first 4 decodes is actually the struct allocating when passing it in, so primitives are actually zero allocation.
268268

269269
```go
270270
go test -bench=. -benchmem=true
271271

272272
PASS
273-
BenchmarkSimpleUserDecodeStruct-8 5000000 336 ns/op 64 B/op 1 allocs/op
274-
BenchmarkSimpleUserDecodeStructParallel-8 20000000 99.5 ns/op 64 B/op 1 allocs/op
275-
BenchmarkSimpleUserEncodeStruct-8 2000000 972 ns/op 485 B/op 11 allocs/op
276-
BenchmarkSimpleUserEncodeStructParallel-8 5000000 329 ns/op 485 B/op 11 allocs/op
277-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1000000 1014 ns/op 96 B/op 1 allocs/op
278-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 294 ns/op 96 B/op 1 allocs/op
279-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4799 ns/op 3009 B/op 46 allocs/op
280-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1581 ns/op 3010 B/op 46 allocs/op
281-
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 16326 ns/op 2257 B/op 121 allocs/op
282-
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 4710 ns/op 2257 B/op 121 allocs/op
283-
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 16303 ns/op 7288 B/op 146 allocs/op
284-
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 4979 ns/op 7290 B/op 146 allocs/op
285-
BenchmarkComplexMapDecodeStructAllTypes-8 100000 21998 ns/op 5306 B/op 130 allocs/op
286-
BenchmarkComplexMapDecodeStructAllTypesParallel-8 200000 6542 ns/op 5308 B/op 130 allocs/op
287-
BenchmarkComplexMapEncodeStructAllTypes-8 100000 17069 ns/op 7100 B/op 175 allocs/op
288-
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5609 ns/op 7099 B/op 175 allocs/op
289-
BenchmarkDecodeNestedStruct-8 500000 3366 ns/op 384 B/op 14 allocs/op
290-
BenchmarkDecodeNestedStructParallel-8 2000000 1096 ns/op 384 B/op 14 allocs/op
291-
BenchmarkEncodeNestedStruct-8 1000000 2230 ns/op 704 B/op 16 allocs/op
292-
BenchmarkEncodeNestedStructParallel-8 2000000 780 ns/op 704 B/op 16 allocs/op
273+
BenchmarkSimpleUserDecodeStruct-8 5000000 312 ns/op 64 B/op 1 allocs/op
274+
BenchmarkSimpleUserDecodeStructParallel-8 20000000 91.7 ns/op 64 B/op 1 allocs/op
275+
BenchmarkSimpleUserEncodeStruct-8 2000000 902 ns/op 485 B/op 11 allocs/op
276+
BenchmarkSimpleUserEncodeStructParallel-8 5000000 301 ns/op 485 B/op 11 allocs/op
277+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 2000000 1028 ns/op 96 B/op 1 allocs/op
278+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 292 ns/op 96 B/op 1 allocs/op
279+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4770 ns/op 3009 B/op 46 allocs/op
280+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1569 ns/op 3010 B/op 46 allocs/op
281+
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 15973 ns/op 2257 B/op 121 allocs/op
282+
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 4801 ns/op 2257 B/op 121 allocs/op
283+
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 15401 ns/op 7289 B/op 146 allocs/op
284+
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 5167 ns/op 7289 B/op 146 allocs/op
285+
BenchmarkComplexMapDecodeStructAllTypes-8 50000 20683 ns/op 5307 B/op 130 allocs/op
286+
BenchmarkComplexMapDecodeStructAllTypesParallel-8 300000 6880 ns/op 5310 B/op 130 allocs/op
287+
BenchmarkComplexMapEncodeStructAllTypes-8 100000 15567 ns/op 7098 B/op 175 allocs/op
288+
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5546 ns/op 7099 B/op 175 allocs/op
289+
BenchmarkDecodeNestedStruct-8 500000 3142 ns/op 384 B/op 14 allocs/op
290+
BenchmarkDecodeNestedStructParallel-8 1000000 1012 ns/op 384 B/op 14 allocs/op
291+
BenchmarkEncodeNestedStruct-8 1000000 2106 ns/op 704 B/op 16 allocs/op
292+
BenchmarkEncodeNestedStructParallel-8 2000000 772 ns/op 704 B/op 16 allocs/op
293293
```
294294

295295
Competitor benchmarks can be found [here](https://github.com/go-playground/form/blob/master/benchmarks/benchmarks.md)

0 commit comments

Comments
 (0)