Skip to content

Commit 60fc727

Browse files
joeybloggsjoeybloggs
authored andcommitted
update benchmarks
- updates have increased some and lowered others, however on a whole library is much more balanced between complex and primitive Decoding/Encoding and in more complex scenarios has drastically less allocations.
1 parent cf93276 commit 60fc727

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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 290 ns/op 64 B/op 1 allocs/op
272-
BenchmarkSimpleUserDecodeStructParallel-8 20000000 99.9 ns/op 64 B/op 1 allocs/op
273-
BenchmarkSimpleUserEncodeStruct-8 2000000 806 ns/op 466 B/op 7 allocs/op
274-
BenchmarkSimpleUserEncodeStructParallel-8 5000000 297 ns/op 466 B/op 7 allocs/op
275-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 2000000 911 ns/op 96 B/op 1 allocs/op
276-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 252 ns/op 96 B/op 1 allocs/op
277-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4293 ns/op 2912 B/op 32 allocs/op
278-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1451 ns/op 2913 B/op 32 allocs/op
279-
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 17295 ns/op 2682 B/op 135 allocs/op
280-
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 5112 ns/op 2686 B/op 135 allocs/op
281-
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 17128 ns/op 7191 B/op 154 allocs/op
282-
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 5520 ns/op 7192 B/op 154 allocs/op
283-
BenchmarkComplexMapDecodeStructAllTypes-8 50000 26311 ns/op 7474 B/op 161 allocs/op
284-
BenchmarkComplexMapDecodeStructAllTypesParallel-8 200000 8539 ns/op 7504 B/op 161 allocs/op
285-
BenchmarkComplexMapEncodeStructAllTypes-8 100000 18627 ns/op 7095 B/op 177 allocs/op
286-
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5922 ns/op 7098 B/op 177 allocs/op
287-
BenchmarkDecodeNestedStruct-8 300000 4815 ns/op 1040 B/op 31 allocs/op
288-
BenchmarkDecodeNestedStructParallel-8 1000000 1613 ns/op 1040 B/op 31 allocs/op
289-
BenchmarkEncodeNestedStruct-8 500000 2995 ns/op 848 B/op 26 allocs/op
290-
BenchmarkEncodeNestedStructParallel-8 1000000 1031 ns/op 848 B/op 26 allocs/op
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
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: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
### go-playground/form
44
```go
5-
BenchmarkSimpleUserDecodeStruct-8 5000000 290 ns/op 64 B/op 1 allocs/op
6-
BenchmarkSimpleUserDecodeStructParallel-8 20000000 99.9 ns/op 64 B/op 1 allocs/op
7-
BenchmarkSimpleUserEncodeStruct-8 2000000 806 ns/op 466 B/op 7 allocs/op
8-
BenchmarkSimpleUserEncodeStructParallel-8 5000000 297 ns/op 466 B/op 7 allocs/op
9-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 2000000 911 ns/op 96 B/op 1 allocs/op
10-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 252 ns/op 96 B/op 1 allocs/op
11-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4293 ns/op 2912 B/op 32 allocs/op
12-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1451 ns/op 2913 B/op 32 allocs/op
13-
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 17295 ns/op 2682 B/op 135 allocs/op
14-
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 5112 ns/op 2686 B/op 135 allocs/op
15-
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 17128 ns/op 7191 B/op 154 allocs/op
16-
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 5520 ns/op 7192 B/op 154 allocs/op
17-
BenchmarkComplexMapDecodeStructAllTypes-8 50000 26311 ns/op 7474 B/op 161 allocs/op
18-
BenchmarkComplexMapDecodeStructAllTypesParallel-8 200000 8539 ns/op 7504 B/op 161 allocs/op
19-
BenchmarkComplexMapEncodeStructAllTypes-8 100000 18627 ns/op 7095 B/op 177 allocs/op
20-
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5922 ns/op 7098 B/op 177 allocs/op
21-
BenchmarkDecodeNestedStruct-8 300000 4815 ns/op 1040 B/op 31 allocs/op
22-
BenchmarkDecodeNestedStructParallel-8 1000000 1613 ns/op 1040 B/op 31 allocs/op
23-
BenchmarkEncodeNestedStruct-8 500000 2995 ns/op 848 B/op 26 allocs/op
24-
BenchmarkEncodeNestedStructParallel-8 1000000 1031 ns/op 848 B/op 26 allocs/op
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
2525
```
2626

2727
### gorilla/schema

0 commit comments

Comments
 (0)