Skip to content

Commit

Permalink
Unit tests and Benchmarks for parseRequestBody function
Browse files Browse the repository at this point in the history
```shell
% go test -benchmem -bench=. -run=^Benchmark
goos: darwin
goarch: amd64
pkg: github.com/go-resty/resty/v2
cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Benchmark_parseRequestBody_string-16                                     2194669               550.2 ns/op           128 B/op          3 allocs/op
Benchmark_parseRequestBody_byte-16                                       2260675               531.5 ns/op           128 B/op          3 allocs/op
Benchmark_parseRequestBody_reader_with_SetContentLength-16               8393974               141.4 ns/op            16 B/op          1 allocs/op
Benchmark_parseRequestBody_reader_without_SetContentLength-16           14253069                84.30 ns/op            0 B/op          0 allocs/op
Benchmark_parseRequestBody_struct-16                                      880549              1307 ns/op             155 B/op          5 allocs/op
Benchmark_parseRequestBody_struct_xml-16                                  424707              2886 ns/op            4762 B/op         13 allocs/op
Benchmark_parseRequestBody_map-16                                         547629              2152 ns/op             569 B/op         15 allocs/op
Benchmark_parseRequestBody_slice-16                                       959576              1264 ns/op             146 B/op          4 allocs/op
Benchmark_parseRequestBody_FormData-16                                    973964              1243 ns/op             304 B/op         14 allocs/op
Benchmark_parseRequestBody_MultiPart-16                                    98246             12320 ns/op            8746 B/op        131 allocs/op
```
  • Loading branch information
SVilgelm committed Sep 29, 2023
1 parent 41199c3 commit 46637d6
Showing 1 changed file with 560 additions and 0 deletions.
Loading

0 comments on commit 46637d6

Please sign in to comment.