Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package form
============
<img align="right" src="https://raw.githubusercontent.com/go-playground/form/master/logo.jpg">
![Project status](https://img.shields.io/badge/version-2.2.2-green.svg)
![Project status](https://img.shields.io/badge/version-2.3.0-green.svg)
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/form/branches/master/badge.svg)](https://semaphoreci.com/joeybloggs/form)
[![Coverage Status](https://coveralls.io/repos/github/go-playground/form/badge.svg?branch=master)](https://coveralls.io/github/go-playground/form?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/form)](https://goreportcard.com/report/github.com/go-playground/form)
Expand Down Expand Up @@ -266,34 +266,34 @@ Field []*string{nil, nil, &i}

Benchmarks
------
###### 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
###### Run on i5-7600 16 GB DDR4-2400 using Go version go1.7.5 linux/amd64

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.

```go
go test -bench=. -benchmem=true

PASS
BenchmarkSimpleUserDecodeStruct-8 5000000 312 ns/op 64 B/op 1 allocs/op
BenchmarkSimpleUserDecodeStructParallel-8 20000000 91.7 ns/op 64 B/op 1 allocs/op
BenchmarkSimpleUserEncodeStruct-8 2000000 902 ns/op 485 B/op 11 allocs/op
BenchmarkSimpleUserEncodeStructParallel-8 5000000 301 ns/op 485 B/op 11 allocs/op
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-8 2000000 1028 ns/op 96 B/op 1 allocs/op
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-8 5000000 292 ns/op 96 B/op 1 allocs/op
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-8 300000 4770 ns/op 3009 B/op 46 allocs/op
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-8 1000000 1569 ns/op 3010 B/op 46 allocs/op
BenchmarkComplexArrayDecodeStructAllTypes-8 100000 15973 ns/op 2257 B/op 121 allocs/op
BenchmarkComplexArrayDecodeStructAllTypesParallel-8 300000 4801 ns/op 2257 B/op 121 allocs/op
BenchmarkComplexArrayEncodeStructAllTypes-8 100000 15401 ns/op 7289 B/op 146 allocs/op
BenchmarkComplexArrayEncodeStructAllTypesParallel-8 300000 5167 ns/op 7289 B/op 146 allocs/op
BenchmarkComplexMapDecodeStructAllTypes-8 50000 20683 ns/op 5307 B/op 130 allocs/op
BenchmarkComplexMapDecodeStructAllTypesParallel-8 300000 6880 ns/op 5310 B/op 130 allocs/op
BenchmarkComplexMapEncodeStructAllTypes-8 100000 15567 ns/op 7098 B/op 175 allocs/op
BenchmarkComplexMapEncodeStructAllTypesParallel-8 300000 5546 ns/op 7099 B/op 175 allocs/op
BenchmarkDecodeNestedStruct-8 500000 3142 ns/op 384 B/op 14 allocs/op
BenchmarkDecodeNestedStructParallel-8 1000000 1012 ns/op 384 B/op 14 allocs/op
BenchmarkEncodeNestedStruct-8 1000000 2106 ns/op 704 B/op 16 allocs/op
BenchmarkEncodeNestedStructParallel-8 2000000 772 ns/op 704 B/op 16 allocs/op
BenchmarkSimpleUserDecodeStruct-4 5000000 252 ns/op 64 B/op 1 allocs/op
BenchmarkSimpleUserDecodeStructParallel-4 20000000 74.1 ns/op 64 B/op 1 allocs/op
BenchmarkSimpleUserEncodeStruct-4 2000000 800 ns/op 485 B/op 11 allocs/op
BenchmarkSimpleUserEncodeStructParallel-4 10000000 220 ns/op 485 B/op 11 allocs/op
BenchmarkPrimitivesDecodeStructAllPrimitivesTypes-4 2000000 773 ns/op 96 B/op 1 allocs/op
BenchmarkPrimitivesDecodeStructAllPrimitivesTypesParallel-4 10000000 225 ns/op 96 B/op 1 allocs/op
BenchmarkPrimitivesEncodeStructAllPrimitivesTypes-4 300000 4330 ns/op 3009 B/op 46 allocs/op
BenchmarkPrimitivesEncodeStructAllPrimitivesTypesParallel-4 1000000 1131 ns/op 3009 B/op 46 allocs/op
BenchmarkComplexArrayDecodeStructAllTypes-4 100000 13316 ns/op 2256 B/op 121 allocs/op
BenchmarkComplexArrayDecodeStructAllTypesParallel-4 300000 3980 ns/op 2256 B/op 121 allocs/op
BenchmarkComplexArrayEncodeStructAllTypes-4 100000 14038 ns/op 7287 B/op 146 allocs/op
BenchmarkComplexArrayEncodeStructAllTypesParallel-4 300000 3646 ns/op 7288 B/op 146 allocs/op
BenchmarkComplexMapDecodeStructAllTypes-4 100000 18042 ns/op 5305 B/op 130 allocs/op
BenchmarkComplexMapDecodeStructAllTypesParallel-4 300000 5051 ns/op 5306 B/op 130 allocs/op
BenchmarkComplexMapEncodeStructAllTypes-4 100000 14177 ns/op 7098 B/op 175 allocs/op
BenchmarkComplexMapEncodeStructAllTypesParallel-4 300000 3693 ns/op 7098 B/op 175 allocs/op
BenchmarkDecodeNestedStruct-4 500000 2762 ns/op 384 B/op 14 allocs/op
BenchmarkDecodeNestedStructParallel-4 2000000 785 ns/op 384 B/op 14 allocs/op
BenchmarkEncodeNestedStruct-4 1000000 1779 ns/op 704 B/op 16 allocs/op
BenchmarkEncodeNestedStructParallel-4 3000000 493 ns/op 704 B/op 16 allocs/op
```

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