-
Notifications
You must be signed in to change notification settings - Fork 679
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve parseRequesBody and add additional benchmarks
Final benchmarks: ```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 7623501 155.3 ns/op 16 B/op 1 allocs/op Benchmark_parseRequestBody_byte-16 8421992 141.6 ns/op 16 B/op 1 allocs/op Benchmark_parseRequestBody_reader_with_SetContentLength-16 17632350 67.37 ns/op 16 B/op 1 allocs/op Benchmark_parseRequestBody_reader_without_SetContentLength-16 26575016 45.34 ns/op 0 B/op 0 allocs/op Benchmark_parseRequestBody_struct-16 1243986 953.8 ns/op 40 B/op 2 allocs/op Benchmark_parseRequestBody_struct_xml-16 495250 2458 ns/op 4647 B/op 10 allocs/op Benchmark_parseRequestBody_map-16 694786 1761 ns/op 454 B/op 12 allocs/op Benchmark_parseRequestBody_slice-16 1304724 913.1 ns/op 32 B/op 2 allocs/op Benchmark_parseRequestBody_FormData-16 1000000 1128 ns/op 272 B/op 9 allocs/op Benchmark_parseRequestBody_MultiPart-16 93248 12583 ns/op 8738 B/op 130 allocs/op ```
- Loading branch information
Showing
2 changed files
with
39 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters