|
1 | 1 | Package form |
2 | 2 | ============ |
3 | 3 | <img align="right" src="https://raw.githubusercontent.com/go-playground/form/master/logo.jpg"> |
4 | | - |
| 4 | + |
5 | 5 | [](https://semaphoreci.com/joeybloggs/form) |
6 | 6 | [](https://coveralls.io/github/go-playground/form?branch=master) |
7 | 7 | [](https://goreportcard.com/report/github.com/go-playground/form) |
@@ -266,34 +266,34 @@ Field []*string{nil, nil, &i} |
266 | 266 |
|
267 | 267 | Benchmarks |
268 | 268 | ------ |
269 | | -###### 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 |
| 269 | +###### Run on i5-7600 16 GB DDR4-2400 using Go version go1.7.5 linux/amd64 |
270 | 270 |
|
271 | 271 | 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. |
272 | 272 |
|
273 | 273 | ```go |
274 | 274 | go test -bench=. -benchmem=true |
275 | 275 |
|
276 | 276 | PASS |
277 | | -BenchmarkSimpleUserDecodeStruct-8 5000000 312 ns/op 64 B/op 1 allocs/op |
278 | | -BenchmarkSimpleUserDecodeStructParallel-8 20000000 91.7 ns/op 64 B/op 1 allocs/op |
279 | | -BenchmarkSimpleUserEncodeStruct-8 2000000 902 ns/op 485 B/op 11 allocs/op |
280 | | -BenchmarkSimpleUserEncodeStructParallel-8 5000000 301 ns/op 485 B/op 11 allocs/op |
281 | | -BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 2000000 1028 ns/op 96 B/op 1 allocs/op |
282 | | -BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 292 ns/op 96 B/op 1 allocs/op |
283 | | -BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4770 ns/op 3009 B/op 46 allocs/op |
284 | | -BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1569 ns/op 3010 B/op 46 allocs/op |
285 | | -BenchmarkComplexArrayDecodeStructAllTypes-8 100000 15973 ns/op 2257 B/op 121 allocs/op |
286 | | -BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 4801 ns/op 2257 B/op 121 allocs/op |
287 | | -BenchmarkComplexArrayEncodeStructAllTypes-8 100000 15401 ns/op 7289 B/op 146 allocs/op |
288 | | -BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 5167 ns/op 7289 B/op 146 allocs/op |
289 | | -BenchmarkComplexMapDecodeStructAllTypes-8 50000 20683 ns/op 5307 B/op 130 allocs/op |
290 | | -BenchmarkComplexMapDecodeStructAllTypesParallel-8 300000 6880 ns/op 5310 B/op 130 allocs/op |
291 | | -BenchmarkComplexMapEncodeStructAllTypes-8 100000 15567 ns/op 7098 B/op 175 allocs/op |
292 | | -BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5546 ns/op 7099 B/op 175 allocs/op |
293 | | -BenchmarkDecodeNestedStruct-8 500000 3142 ns/op 384 B/op 14 allocs/op |
294 | | -BenchmarkDecodeNestedStructParallel-8 1000000 1012 ns/op 384 B/op 14 allocs/op |
295 | | -BenchmarkEncodeNestedStruct-8 1000000 2106 ns/op 704 B/op 16 allocs/op |
296 | | -BenchmarkEncodeNestedStructParallel-8 2000000 772 ns/op 704 B/op 16 allocs/op |
| 277 | +BenchmarkSimpleUserDecodeStruct-4 5000000 252 ns/op 64 B/op 1 allocs/op |
| 278 | +BenchmarkSimpleUserDecodeStructParallel-4 20000000 74.1 ns/op 64 B/op 1 allocs/op |
| 279 | +BenchmarkSimpleUserEncodeStruct-4 2000000 800 ns/op 485 B/op 11 allocs/op |
| 280 | +BenchmarkSimpleUserEncodeStructParallel-4 10000000 220 ns/op 485 B/op 11 allocs/op |
| 281 | +BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-4 2000000 773 ns/op 96 B/op 1 allocs/op |
| 282 | +BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-4 10000000 225 ns/op 96 B/op 1 allocs/op |
| 283 | +BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-4 300000 4330 ns/op 3009 B/op 46 allocs/op |
| 284 | +BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-4 1000000 1131 ns/op 3009 B/op 46 allocs/op |
| 285 | +BenchmarkComplexArrayDecodeStructAllTypes-4 100000 13316 ns/op 2256 B/op 121 allocs/op |
| 286 | +BenchmarkComplexArrayDecodeStructAllTypesParallel-4 300000 3980 ns/op 2256 B/op 121 allocs/op |
| 287 | +BenchmarkComplexArrayEncodeStructAllTypes-4 100000 14038 ns/op 7287 B/op 146 allocs/op |
| 288 | +BenchmarkComplexArrayEncodeStructAllTypesParallel-4 300000 3646 ns/op 7288 B/op 146 allocs/op |
| 289 | +BenchmarkComplexMapDecodeStructAllTypes-4 100000 18042 ns/op 5305 B/op 130 allocs/op |
| 290 | +BenchmarkComplexMapDecodeStructAllTypesParallel-4 300000 5051 ns/op 5306 B/op 130 allocs/op |
| 291 | +BenchmarkComplexMapEncodeStructAllTypes-4 100000 14177 ns/op 7098 B/op 175 allocs/op |
| 292 | +BenchmarkComplexMapEncodeStructAllTypesParallel-4 300000 3693 ns/op 7098 B/op 175 allocs/op |
| 293 | +BenchmarkDecodeNestedStruct-4 500000 2762 ns/op 384 B/op 14 allocs/op |
| 294 | +BenchmarkDecodeNestedStructParallel-4 2000000 785 ns/op 384 B/op 14 allocs/op |
| 295 | +BenchmarkEncodeNestedStruct-4 1000000 1779 ns/op 704 B/op 16 allocs/op |
| 296 | +BenchmarkEncodeNestedStructParallel-4 3000000 493 ns/op 704 B/op 16 allocs/op |
297 | 297 | ``` |
298 | 298 |
|
299 | 299 | Competitor benchmarks can be found [here](https://github.com/go-playground/form/blob/master/benchmarks/benchmarks.md) |
|
0 commit comments