Skip to content

Commit 7b3f7e7

Browse files
author
Dean Karn
committed
updte README + benchmarks
1 parent 46f6202 commit 7b3f7e7

File tree

2 files changed

+85
-83
lines changed

2 files changed

+85
-83
lines changed

README.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package form
22
============
3-
<img align="right" src="https://raw.githubusercontent.com/go-playground/form/master/logo.jpg">![Project status](https://img.shields.io/badge/version-3.0.0-green.svg)
3+
<img align="right" src="https://raw.githubusercontent.com/go-playground/form/master/logo.jpg">![Project status](https://img.shields.io/badge/version-3.0.1-green.svg)
44
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/form/branches/master/badge.svg)](https://semaphoreci.com/joeybloggs/form)
55
[![Coverage Status](https://coveralls.io/repos/github/go-playground/form/badge.svg?branch=master)](https://coveralls.io/github/go-playground/form?branch=master)
66
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/form)](https://goreportcard.com/report/github.com/go-playground/form)
@@ -275,34 +275,36 @@ Field []*string{nil, nil, &i}
275275

276276
Benchmarks
277277
------
278-
###### Run on i5-7600 16 GB DDR4-2400 using Go version go1.7.5 linux/amd64
278+
###### Run on MacBook Pro (15-inch, 2017) using go version go1.9 darwin/amd64
279279

280280
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.
281281

282282
```go
283-
go test -bench=. -benchmem=true
284-
285-
PASS
286-
BenchmarkSimpleUserDecodeStruct-4 5000000 252 ns/op 64 B/op 1 allocs/op
287-
BenchmarkSimpleUserDecodeStructParallel-4 20000000 74.1 ns/op 64 B/op 1 allocs/op
288-
BenchmarkSimpleUserEncodeStruct-4 2000000 800 ns/op 485 B/op 11 allocs/op
289-
BenchmarkSimpleUserEncodeStructParallel-4 10000000 220 ns/op 485 B/op 11 allocs/op
290-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-4 2000000 773 ns/op 96 B/op 1 allocs/op
291-
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-4 10000000 225 ns/op 96 B/op 1 allocs/op
292-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-4 300000 4330 ns/op 3009 B/op 46 allocs/op
293-
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-4 1000000 1131 ns/op 3009 B/op 46 allocs/op
294-
BenchmarkComplexArrayDecodeStructAllTypes-4 100000 13316 ns/op 2256 B/op 121 allocs/op
295-
BenchmarkComplexArrayDecodeStructAllTypesParallel-4 300000 3980 ns/op 2256 B/op 121 allocs/op
296-
BenchmarkComplexArrayEncodeStructAllTypes-4 100000 14038 ns/op 7287 B/op 146 allocs/op
297-
BenchmarkComplexArrayEncodeStructAllTypesParallel-4 300000 3646 ns/op 7288 B/op 146 allocs/op
298-
BenchmarkComplexMapDecodeStructAllTypes-4 100000 18042 ns/op 5305 B/op 130 allocs/op
299-
BenchmarkComplexMapDecodeStructAllTypesParallel-4 300000 5051 ns/op 5306 B/op 130 allocs/op
300-
BenchmarkComplexMapEncodeStructAllTypes-4 100000 14177 ns/op 7098 B/op 175 allocs/op
301-
BenchmarkComplexMapEncodeStructAllTypesParallel-4 300000 3693 ns/op 7098 B/op 175 allocs/op
302-
BenchmarkDecodeNestedStruct-4 500000 2762 ns/op 384 B/op 14 allocs/op
303-
BenchmarkDecodeNestedStructParallel-4 2000000 785 ns/op 384 B/op 14 allocs/op
304-
BenchmarkEncodeNestedStruct-4 1000000 1779 ns/op 704 B/op 16 allocs/op
305-
BenchmarkEncodeNestedStructParallel-4 3000000 493 ns/op 704 B/op 16 allocs/op
283+
go test -run=NONE -bench=. -benchmem=true
284+
goos: darwin
285+
goarch: amd64
286+
pkg: github.com/go-playground/form/benchmarks
287+
288+
BenchmarkSimpleUserDecodeStruct-8 5000000 243 ns/op 64 B/op 1 allocs/op
289+
BenchmarkSimpleUserDecodeStructParallel-8 20000000 72.4 ns/op 64 B/op 1 allocs/op
290+
BenchmarkSimpleUserEncodeStruct-8 2000000 683 ns/op 485 B/op 10 allocs/op
291+
BenchmarkSimpleUserEncodeStructParallel-8 10000000 205 ns/op 485 B/op 10 allocs/op
292+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 2000000 739 ns/op 96 B/op 1 allocs/op
293+
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 10000000 214 ns/op 96 B/op 1 allocs/op
294+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 500000 3608 ns/op 2977 B/op 36 allocs/op
295+
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1013 ns/op 2978 B/op 36 allocs/op
296+
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 13358 ns/op 2249 B/op 121 allocs/op
297+
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 500000 3656 ns/op 2249 B/op 121 allocs/op
298+
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 11574 ns/op 7112 B/op 104 allocs/op
299+
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 500000 3278 ns/op 7112 B/op 104 allocs/op
300+
BenchmarkComplexMapDecodeStructAllTypes-8 100000 18945 ns/op 5305 B/op 130 allocs/op
301+
BenchmarkComplexMapDecodeStructAllTypesParallel-8 300000 5213 ns/op 5308 B/op 130 allocs/op
302+
BenchmarkComplexMapEncodeStructAllTypes-8 100000 12177 ns/op 6972 B/op 129 allocs/op
303+
BenchmarkComplexMapEncodeStructAllTypesParallel-8 500000 3409 ns/op 6971 B/op 129 allocs/op
304+
BenchmarkDecodeNestedStruct-8 500000 2642 ns/op 384 B/op 14 allocs/op
305+
BenchmarkDecodeNestedStructParallel-8 2000000 760 ns/op 384 B/op 14 allocs/op
306+
BenchmarkEncodeNestedStruct-8 1000000 1686 ns/op 693 B/op 16 allocs/op
307+
BenchmarkEncodeNestedStructParallel-8 3000000 468 ns/op 693 B/op 16 allocs/op
306308
```
307309

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

0 commit comments

Comments
 (0)