Skip to content

Commit 0c37d20

Browse files
joeybloggsjoeybloggs
authored andcommitted
update benchmarks
- minor changes making a 10-20% difference in parallel tests ``` benchmark old ns/op new ns/op delta BenchmarkSimpleUserDecodeStruct-8 319 308 -3.45% BenchmarkSimpleUserDecodeStructParallel-8 116 94.8 -18.28% BenchmarkSimpleUserEncodeStruct-8 1015 989 -2.56% BenchmarkSimpleUserEncodeStructParallel-8 411 332 -19.22% BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1038 1004 -3.28% BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 368 291 -20.92% BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 5014 4771 -4.85% BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1973 1575 -20.17% BenchmarkComplexArrayDecodeStructAllTypes-8 17656 17087 -3.22% BenchmarkComplexArrayDecodeStructAllTypesParallel-8 5801 5020 -13.46% BenchmarkComplexArrayEncodeStructAllTypes-8 16318 16219 -0.61% BenchmarkComplexArrayEncodeStructAllTypesParallel-8 5955 4961 -16.69% BenchmarkComplexMapDecodeStructAllTypes-8 25196 24898 -1.18% BenchmarkComplexMapDecodeStructAllTypesParallel-8 9443 7771 -17.71% BenchmarkComplexMapEncodeStructAllTypes-8 17061 16885 -1.03% BenchmarkComplexMapEncodeStructAllTypesParallel-8 6375 5851 -8.22% BenchmarkDecodeNestedStruct-8 4102 3848 -6.19% BenchmarkDecodeNestedStructParallel-8 1399 1325 -5.29% BenchmarkEncodeNestedStruct-8 2440 2319 -4.96% BenchmarkEncodeNestedStructParallel-8 1045 874 -16.36% benchmark old allocs new allocs delta BenchmarkSimpleUserDecodeStruct-8 1 1 +0.00% BenchmarkSimpleUserDecodeStructParallel-8 1 1 +0.00% BenchmarkSimpleUserEncodeStruct-8 12 12 +0.00% BenchmarkSimpleUserEncodeStructParallel-8 12 12 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1 1 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 1 1 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 47 47 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 47 47 +0.00% BenchmarkComplexArrayDecodeStructAllTypes-8 123 123 +0.00% BenchmarkComplexArrayDecodeStructAllTypesParallel-8 123 123 +0.00% BenchmarkComplexArrayEncodeStructAllTypes-8 147 147 +0.00% BenchmarkComplexArrayEncodeStructAllTypesParallel-8 147 147 +0.00% BenchmarkComplexMapDecodeStructAllTypes-8 135 135 +0.00% BenchmarkComplexMapDecodeStructAllTypesParallel-8 135 135 +0.00% BenchmarkComplexMapEncodeStructAllTypes-8 176 176 +0.00% BenchmarkComplexMapEncodeStructAllTypesParallel-8 176 176 +0.00% BenchmarkDecodeNestedStruct-8 16 16 +0.00% BenchmarkDecodeNestedStructParallel-8 16 16 +0.00% BenchmarkEncodeNestedStruct-8 17 17 +0.00% BenchmarkEncodeNestedStructParallel-8 17 17 +0.00% benchmark old bytes new bytes delta BenchmarkSimpleUserDecodeStruct-8 64 64 +0.00% BenchmarkSimpleUserDecodeStructParallel-8 64 64 +0.00% BenchmarkSimpleUserEncodeStruct-8 549 549 +0.00% BenchmarkSimpleUserEncodeStructParallel-8 549 549 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 96 96 +0.00% BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 96 96 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 3073 3073 +0.00% BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 3072 3073 +0.03% BenchmarkComplexArrayDecodeStructAllTypes-8 2515 2513 -0.08% BenchmarkComplexArrayDecodeStructAllTypesParallel-8 2518 2518 +0.00% BenchmarkComplexArrayEncodeStructAllTypes-8 7351 7350 -0.01% BenchmarkComplexArrayEncodeStructAllTypesParallel-8 7351 7351 +0.00% BenchmarkComplexMapDecodeStructAllTypes-8 7089 7088 -0.01% BenchmarkComplexMapDecodeStructAllTypesParallel-8 7123 7121 -0.03% BenchmarkComplexMapEncodeStructAllTypes-8 7162 7159 -0.04% BenchmarkComplexMapEncodeStructAllTypesParallel-8 7160 7161 +0.01% BenchmarkDecodeNestedStruct-8 640 640 +0.00% BenchmarkDecodeNestedStructParallel-8 640 640 +0.00% BenchmarkEncodeNestedStruct-8 768 768 +0.00% BenchmarkEncodeNestedStructParallel-8 768 768 +0.00% ```
1 parent b261f51 commit 0c37d20

File tree

2 files changed

+42
-41
lines changed

2 files changed

+42
-41
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package form
22
============
33
<img align="right" src="https://raw.githubusercontent.com/go-playground/form/master/logo.jpg">
4-
![Project status](https://img.shields.io/badge/version-1.8.0-green.svg)
4+
![Project status](https://img.shields.io/badge/version-1.9.0-green.svg)
55
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/form/branches/master/badge.svg)](https://semaphoreci.com/joeybloggs/form)
66
[![Coverage Status](https://coveralls.io/repos/github/go-playground/form/badge.svg?branch=master)](https://coveralls.io/github/go-playground/form?branch=master)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/form)](https://goreportcard.com/report/github.com/go-playground/form)
@@ -268,26 +268,26 @@ NOTE: the 1 allocation and B/op in the first 4 decodes is actually the struct al
268268
go test -bench=. -benchmem=true
269269

270270
PASS
271-
BenchmarkSimpleUserDecodeStruct-8 5000000 319 ns/op 64 B/op 1 allocs/op
272-
BenchmarkSimpleUserDecodeStructParallel-8 20000000 116 ns/op 64 B/op 1 allocs/op
273-
BenchmarkSimpleUserEncodeStruct-8 1000000 1015 ns/op 549 B/op 12 allocs/op
274-
BenchmarkSimpleUserEncodeStructParallel-8 5000000 411 ns/op 549 B/op 12 allocs/op
275-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1000000 1038 ns/op 96 B/op 1 allocs/op
276-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 368 ns/op 96 B/op 1 allocs/op
277-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 200000 5014 ns/op 3073 B/op 47 allocs/op
278-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1973 ns/op 3072 B/op 47 allocs/op
279-
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 17656 ns/op 2515 B/op 123 allocs/op
280-
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 5801 ns/op 2518 B/op 123 allocs/op
281-
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 16318 ns/op 7351 B/op 147 allocs/op
282-
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 5955 ns/op 7351 B/op 147 allocs/op
283-
BenchmarkComplexMapDecodeStructAllTypes-8 50000 25196 ns/op 7089 B/op 135 allocs/op
284-
BenchmarkComplexMapDecodeStructAllTypesParallel-8 200000 9443 ns/op 7123 B/op 135 allocs/op
285-
BenchmarkComplexMapEncodeStructAllTypes-8 100000 17061 ns/op 7162 B/op 176 allocs/op
286-
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 6375 ns/op 7160 B/op 176 allocs/op
287-
BenchmarkDecodeNestedStruct-8 300000 4102 ns/op 640 B/op 16 allocs/op
288-
BenchmarkDecodeNestedStructParallel-8 1000000 1399 ns/op 640 B/op 16 allocs/op
289-
BenchmarkEncodeNestedStruct-8 500000 2440 ns/op 768 B/op 17 allocs/op
290-
BenchmarkEncodeNestedStructParallel-8 2000000 1045 ns/op 768 B/op 17 allocs/op
271+
BenchmarkSimpleUserDecodeStruct-8 5000000 308 ns/op 64 B/op 1 allocs/op
272+
BenchmarkSimpleUserDecodeStructParallel-8 20000000 94.8 ns/op 64 B/op 1 allocs/op
273+
BenchmarkSimpleUserEncodeStruct-8 2000000 989 ns/op 549 B/op 12 allocs/op
274+
BenchmarkSimpleUserEncodeStructParallel-8 5000000 332 ns/op 549 B/op 12 allocs/op
275+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1000000 1004 ns/op 96 B/op 1 allocs/op
276+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 291 ns/op 96 B/op 1 allocs/op
277+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4771 ns/op 3073 B/op 47 allocs/op
278+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1575 ns/op 3073 B/op 47 allocs/op
279+
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 17087 ns/op 2513 B/op 123 allocs/op
280+
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 5020 ns/op 2518 B/op 123 allocs/op
281+
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 16219 ns/op 7350 B/op 147 allocs/op
282+
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 4961 ns/op 7351 B/op 147 allocs/op
283+
BenchmarkComplexMapDecodeStructAllTypes-8 50000 24898 ns/op 7088 B/op 135 allocs/op
284+
BenchmarkComplexMapDecodeStructAllTypesParallel-8 200000 7771 ns/op 7121 B/op 135 allocs/op
285+
BenchmarkComplexMapEncodeStructAllTypes-8 100000 16885 ns/op 7159 B/op 176 allocs/op
286+
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5851 ns/op 7161 B/op 176 allocs/op
287+
BenchmarkDecodeNestedStruct-8 300000 3848 ns/op 640 B/op 16 allocs/op
288+
BenchmarkDecodeNestedStructParallel-8 1000000 1325 ns/op 640 B/op 16 allocs/op
289+
BenchmarkEncodeNestedStruct-8 500000 2319 ns/op 768 B/op 17 allocs/op
290+
BenchmarkEncodeNestedStructParallel-8 2000000 874 ns/op 768 B/op 17 allocs/op
291291
```
292292

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

benchmarks/benchmarks.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@
22

33
### go-playground/form
44
```go
5-
BenchmarkSimpleUserDecodeStruct-8 5000000 319 ns/op 64 B/op 1 allocs/op
6-
BenchmarkSimpleUserDecodeStructParallel-8 20000000 116 ns/op 64 B/op 1 allocs/op
7-
BenchmarkSimpleUserEncodeStruct-8 1000000 1015 ns/op 549 B/op 12 allocs/op
8-
BenchmarkSimpleUserEncodeStructParallel-8 5000000 411 ns/op 549 B/op 12 allocs/op
9-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1000000 1038 ns/op 96 B/op 1 allocs/op
10-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 368 ns/op 96 B/op 1 allocs/op
11-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 200000 5014 ns/op 3073 B/op 47 allocs/op
12-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1973 ns/op 3072 B/op 47 allocs/op
13-
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 17656 ns/op 2515 B/op 123 allocs/op
14-
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 5801 ns/op 2518 B/op 123 allocs/op
15-
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 16318 ns/op 7351 B/op 147 allocs/op
16-
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 5955 ns/op 7351 B/op 147 allocs/op
17-
BenchmarkComplexMapDecodeStructAllTypes-8 50000 25196 ns/op 7089 B/op 135 allocs/op
18-
BenchmarkComplexMapDecodeStructAllTypesParallel-8 200000 9443 ns/op 7123 B/op 135 allocs/op
19-
BenchmarkComplexMapEncodeStructAllTypes-8 100000 17061 ns/op 7162 B/op 176 allocs/op
20-
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 6375 ns/op 7160 B/op 176 allocs/op
21-
BenchmarkDecodeNestedStruct-8 300000 4102 ns/op 640 B/op 16 allocs/op
22-
BenchmarkDecodeNestedStructParallel-8 1000000 1399 ns/op 640 B/op 16 allocs/op
23-
BenchmarkEncodeNestedStruct-8 500000 2440 ns/op 768 B/op 17 allocs/op
24-
BenchmarkEncodeNestedStructParallel-8 2000000 1045 ns/op 768 B/op 17 allocs/op
5+
PASS
6+
BenchmarkSimpleUserDecodeStruct-8 5000000 308 ns/op 64 B/op 1 allocs/op
7+
BenchmarkSimpleUserDecodeStructParallel-8 20000000 94.8 ns/op 64 B/op 1 allocs/op
8+
BenchmarkSimpleUserEncodeStruct-8 2000000 989 ns/op 549 B/op 12 allocs/op
9+
BenchmarkSimpleUserEncodeStructParallel-8 5000000 332 ns/op 549 B/op 12 allocs/op
10+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 1000000 1004 ns/op 96 B/op 1 allocs/op
11+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 291 ns/op 96 B/op 1 allocs/op
12+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4771 ns/op 3073 B/op 47 allocs/op
13+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1575 ns/op 3073 B/op 47 allocs/op
14+
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 17087 ns/op 2513 B/op 123 allocs/op
15+
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 5020 ns/op 2518 B/op 123 allocs/op
16+
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 16219 ns/op 7350 B/op 147 allocs/op
17+
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 4961 ns/op 7351 B/op 147 allocs/op
18+
BenchmarkComplexMapDecodeStructAllTypes-8 50000 24898 ns/op 7088 B/op 135 allocs/op
19+
BenchmarkComplexMapDecodeStructAllTypesParallel-8 200000 7771 ns/op 7121 B/op 135 allocs/op
20+
BenchmarkComplexMapEncodeStructAllTypes-8 100000 16885 ns/op 7159 B/op 176 allocs/op
21+
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5851 ns/op 7161 B/op 176 allocs/op
22+
BenchmarkDecodeNestedStruct-8 300000 3848 ns/op 640 B/op 16 allocs/op
23+
BenchmarkDecodeNestedStructParallel-8 1000000 1325 ns/op 640 B/op 16 allocs/op
24+
BenchmarkEncodeNestedStruct-8 500000 2319 ns/op 768 B/op 17 allocs/op
25+
BenchmarkEncodeNestedStructParallel-8 2000000 874 ns/op 768 B/op 17 allocs/op
2526
```
2627

2728
### gorilla/schema

0 commit comments

Comments
 (0)