swaggest / rest

Web services with OpenAPI and JSON Schema done quick in Go
https://pkg.go.dev/github.com/swaggest/rest
MIT License
362 stars 17 forks source link

Add request.Setter interface to capture http.Request #131

Closed vearutop closed 1 year ago

github-actions[bot] commented 1 year ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 105 7488 (+36) 5440 (+26) 496 (+3) 1552 (+7) 925 (+13) 180.8K (+689B)
Go (test) 47 5193 (+28) 3975 (+21) 185 1033 (+7) 179 145.1K (+789B)
github-actions[bot] commented 1 year ago

Go API Changes

# github.com/swaggest/rest/request
## compatible changes
Setter: added

# summary
Inferred base version: v0.2.39
Suggested version: v0.3.0
github-actions[bot] commented 1 year ago

Unit Test Coverage

total: (statements) 83.3% changed lines: (statements) 93.9%

Coverage of changed lines | File | Function | Coverage | |---------------------------------|-------------|----------| | Total | | 93.9% | | request/decoder.go | | 100.0% | | request/decoder.go:85 | Decode | 100.0% | | request/factory.go | | 95.0% | | request/factory.go:153 | initDecoder | 100.0% | | request/factory.go:94 | MakeDecoder | 95.2% | | response/gzip/middleware.go | | 85.7% | | response/gzip/middleware.go:153 | writeHeader | 87.5% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |------------------------------------------------------|-------------|---------------|------------------| | Total | | 83.2% | 83.3% (+0.1%) | | github.com/swaggest/rest/request/factory.go | initDecoder | no function | 100.0% | | github.com/swaggest/rest/response/gzip/middleware.go | writeHeader | 100.0% | 94.7% (-5.3%) |
codecov[bot] commented 1 year ago

Codecov Report

Merging #131 (f48956e) into master (12f37c7) will increase coverage by 0.05%. The diff coverage is 90.00%.

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   77.40%   77.46%   +0.05%     
==========================================
  Files          28       28              
  Lines        1562     1575      +13     
==========================================
+ Hits         1209     1220      +11     
- Misses        232      233       +1     
- Partials      121      122       +1     
Flag Coverage Δ
unittests 77.46% <90.00%> (+0.05%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
response/gzip/middleware.go 77.55% <50.00%> (-1.40%) :arrow_down:
request/factory.go 87.50% <95.00%> (+0.65%) :arrow_up:
request/decoder.go 67.24% <100.00%> (+2.42%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

github-actions[bot] commented 1 year ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 1.32µs ± 1% 1.34µs ± 2% ~ (p=0.143 n=5+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 705ns ± 0% 699ns ± 0% -0.79% (p=0.008 n=5+5) DecoderFunc_Decode-2 2.00µs ± 1% 1.99µs ± 1% ~ (p=0.701 n=5+6) Decoder_Decode_json-2 22.0µs ± 1% 21.8µs ± 0% -1.18% (p=0.009 n=6+6) Decoder_Decode_queryObject-2 4.69µs ± 1% 4.62µs ± 0% -1.48% (p=0.002 n=6+6) Decoder_Decode_jsonParam-2 1.78µs ± 1% 1.78µs ± 2% ~ (p=0.504 n=6+6) DecoderFactory_SetDecoderFunc-2 1.65µs ± 1% 1.64µs ± 1% ~ (p=0.589 n=6+6) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.1µs ± 0% 11.0µs ± 1% ~ (p=0.247 n=5+6) Middleware_control-2 3.47µs ± 1% 3.49µs ± 3% ~ (p=0.818 n=6+6) name old alloc/op new alloc/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 2.46kB ± 0% 2.46kB ± 0% ~ (all equal) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 440B ± 0% 440B ± 0% ~ (all equal) DecoderFunc_Decode-2 1.51kB ± 0% 1.51kB ± 0% ~ (all equal) Decoder_Decode_json-2 12.2kB ± 0% 12.2kB ± 0% ~ (all equal) Decoder_Decode_queryObject-2 2.00kB ± 0% 2.00kB ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 736B ± 0% 736B ± 0% ~ (all equal) DecoderFactory_SetDecoderFunc-2 1.02kB ± 0% 1.02kB ± 0% ~ (all equal) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 1.18kB ± 5% 1.16kB ± 3% ~ (p=0.364 n=6+6) Middleware_control-2 11.2kB ± 0% 11.2kB ± 0% ~ (all equal) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 8.00 ± 0% 8.00 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 4.00 ± 0% 4.00 ± 0% ~ (all equal) DecoderFunc_Decode-2 12.0 ± 0% 12.0 ± 0% ~ (all equal) Decoder_Decode_json-2 177 ± 0% 177 ± 0% ~ (all equal) Decoder_Decode_queryObject-2 36.0 ± 0% 36.0 ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 13.0 ± 0% 13.0 ± 0% ~ (all equal) DecoderFactory_SetDecoderFunc-2 16.0 ± 0% 16.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.0 ± 0% 11.0 ± 0% ~ (all equal) Middleware_control-2 9.00 ± 0% 9.00 ± 0% ~ (all equal) ```
Benchmark result ``` name time/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 1.34µs ± 2% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 699ns ± 0% DecoderFunc_Decode-2 1.99µs ± 1% Decoder_Decode_json-2 21.8µs ± 0% Decoder_Decode_queryObject-2 4.62µs ± 0% Decoder_Decode_jsonParam-2 1.78µs ± 2% DecoderFactory_SetDecoderFunc-2 1.64µs ± 1% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.0µs ± 1% Middleware_control-2 3.49µs ± 3% name alloc/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 2.46kB ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 440B ± 0% DecoderFunc_Decode-2 1.51kB ± 0% Decoder_Decode_json-2 12.2kB ± 0% Decoder_Decode_queryObject-2 2.00kB ± 0% Decoder_Decode_jsonParam-2 736B ± 0% DecoderFactory_SetDecoderFunc-2 1.02kB ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 1.16kB ± 3% Middleware_control-2 11.2kB ± 0% name allocs/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 8.00 ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 4.00 ± 0% DecoderFunc_Decode-2 12.0 ± 0% Decoder_Decode_json-2 177 ± 0% Decoder_Decode_queryObject-2 36.0 ± 0% Decoder_Decode_jsonParam-2 13.0 ± 0% DecoderFactory_SetDecoderFunc-2 16.0 ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.0 ± 0% Middleware_control-2 9.00 ± 0% ```
github-actions[bot] commented 1 year ago

Examples Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 24.9µs ± 2% 25.9µs ±10% ~ (p=0.056 n=5+5) _directGzipHead-2 25.1µs ± 1% 25.1µs ± 1% ~ (p=0.730 n=4+5) _noDirectGzip-2 129µs ± 2% 129µs ± 1% ~ (p=0.690 n=5+5) _directGzip_decode-2 468µs ± 1% 465µs ± 2% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 128µs ± 1% 129µs ± 1% ~ (p=0.310 n=5+5) _jsonBody-2 44.7µs ± 1% 46.2µs ± 2% +3.37% (p=0.008 n=5+5) _jsonBodyValidation-2 50.7µs ± 2% 52.2µs ± 2% +2.90% (p=0.016 n=5+5) _outputHeaders-2 23.5µs ± 2% 23.8µs ± 2% ~ (p=0.421 n=5+5) _requestResponseMapping-2 44.3µs ± 7% 44.2µs ± 1% ~ (p=0.310 n=5+5) _validation-2 46.4µs ± 1% 47.1µs ± 2% ~ (p=0.151 n=5+5) _noValidation-2 34.6µs ± 2% 34.9µs ± 3% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 25.4µs ± 2% 25.0µs ± 1% ~ (p=0.056 n=5+5) _directGzipHead-2 26.2µs ±10% 26.2µs ±13% ~ (p=0.690 n=5+5) _noDirectGzip-2 131µs ± 2% 130µs ± 1% ~ (p=0.690 n=5+5) _directGzip_decode-2 461µs ± 1% 466µs ± 1% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 131µs ± 6% 131µs ± 1% ~ (p=0.421 n=5+5) _htmlResponse-2 39.0µs ± 2% 40.6µs ± 2% +4.10% (p=0.008 n=5+5) _jsonBodyManual-2 28.5µs ± 1% 40.8µs ± 1% +42.97% (p=0.008 n=5+5) _jsonBody-2 41.0µs ± 2% 41.0µs ± 1% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 53.9µs ± 0% 53.1µs ± 2% ~ (p=0.190 n=4+5) _outputHeaders-2 26.1µs ± 1% 25.8µs ± 2% ~ (p=0.690 n=5+5) _requestResponseMapping-2 46.2µs ± 2% 44.6µs ± 2% -3.58% (p=0.008 n=5+5) _validation-2 48.9µs ± 1% 47.8µs ± 1% -2.36% (p=0.016 n=5+4) _noValidation-2 35.5µs ± 1% 35.2µs ± 1% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 28.1µs ± 2% 27.6µs ± 0% -1.89% (p=0.032 n=5+5) _ok-2 28.4µs ± 2% 28.1µs ± 1% ~ (p=0.413 n=5+4) _invalidBody-2 40.1µs ± 2% 39.8µs ± 2% ~ (p=0.548 n=5+5) name old 50%:ms new 50%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 1.21 ± 6% 1.22 ± 6% ~ (p=0.690 n=5+5) _directGzipHead-2 1.29 ± 7% 1.17 ± 4% -9.19% (p=0.008 n=5+5) _noDirectGzip-2 6.24 ± 4% 6.32 ± 4% ~ (p=0.548 n=5+5) _directGzip_decode-2 18.7 ± 5% 18.3 ± 8% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 6.20 ± 4% 6.26 ± 5% ~ (p=0.690 n=5+5) _jsonBody-2 1.99 ± 4% 2.09 ± 6% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 2.26 ± 6% 2.28 ± 5% ~ (p=0.690 n=5+5) _outputHeaders-2 1.13 ± 6% 1.13 ± 5% ~ (p=0.841 n=5+5) _requestResponseMapping-2 1.85 ± 4% 1.91 ± 7% ~ (p=0.421 n=5+5) _validation-2 2.07 ± 6% 2.06 ± 7% ~ (p=1.000 n=5+5) _noValidation-2 1.58 ± 5% 1.56 ± 8% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 1.20 ± 7% 1.18 ± 3% ~ (p=0.746 n=5+5) _directGzipHead-2 1.22 ± 5% 1.24 ± 6% ~ (p=0.690 n=5+5) _noDirectGzip-2 6.23 ± 2% 6.33 ± 5% ~ (p=0.421 n=5+5) _directGzip_decode-2 18.1 ± 4% 18.3 ± 6% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 6.33 ± 5% 6.40 ± 5% ~ (p=0.548 n=5+5) _htmlResponse-2 1.85 ± 8% 1.86 ± 5% ~ (p=1.000 n=5+5) _jsonBodyManual-2 1.39 ± 8% 1.79 ± 3% +29.24% (p=0.008 n=5+5) _jsonBody-2 1.82 ± 5% 1.81 ± 4% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 2.36 ± 5% 2.34 ± 5% ~ (p=0.587 n=5+5) _outputHeaders-2 1.16 ± 2% 1.25 ± 8% +7.70% (p=0.032 n=5+5) _requestResponseMapping-2 1.94 ± 2% 1.82 ± 0% -6.22% (p=0.016 n=5+4) _validation-2 2.06 ± 3% 2.04 ± 5% ~ (p=0.690 n=5+5) _noValidation-2 1.59 ± 6% 1.58 ± 5% ~ (p=0.587 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 1.35 ± 3% 1.33 ± 8% ~ (p=0.246 n=5+5) _ok-2 1.36 ± 9% 1.31 ± 3% ~ (p=0.421 n=5+5) _invalidBody-2 1.77 ± 5% 1.71 ± 4% ~ (p=0.310 n=5+5) name old 90%:ms new 90%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 2.16 ± 4% 2.14 ± 4% ~ (p=0.548 n=5+5) _directGzipHead-2 2.23 ±10% 2.08 ± 2% -6.71% (p=0.032 n=5+5) _noDirectGzip-2 10.9 ± 2% 11.0 ± 5% ~ (p=0.690 n=5+5) _directGzip_decode-2 37.1 ± 4% 38.2 ± 7% ~ (p=0.222 n=5+5) _noDirectGzip_decode-2 11.2 ± 4% 11.1 ± 3% ~ (p=0.548 n=5+5) _jsonBody-2 4.10 ± 7% 4.36 ± 5% +6.27% (p=0.032 n=5+5) _jsonBodyValidation-2 4.75 ± 5% 4.76 ± 5% ~ (p=0.841 n=5+5) _outputHeaders-2 2.05 ± 3% 2.00 ± 7% ~ (p=0.690 n=5+5) _requestResponseMapping-2 4.08 ± 5% 4.20 ± 3% ~ (p=0.421 n=5+5) _validation-2 4.24 ± 6% 4.44 ± 4% ~ (p=0.095 n=5+5) _noValidation-2 3.00 ± 5% 3.08 ± 5% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 2.16 ± 4% 2.09 ± 4% ~ (p=0.095 n=5+5) _directGzipHead-2 2.13 ± 3% 2.09 ± 6% ~ (p=0.548 n=5+5) _noDirectGzip-2 11.1 ± 4% 11.2 ± 2% ~ (p=0.841 n=5+5) _directGzip_decode-2 39.7 ± 7% 38.8 ± 9% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 11.3 ± 5% 11.6 ± 6% ~ (p=0.206 n=5+5) _htmlResponse-2 3.41 ± 5% 3.62 ± 4% +6.25% (p=0.032 n=5+5) _jsonBodyManual-2 2.46 ± 6% 3.66 ± 1% +48.99% (p=0.008 n=5+5) _jsonBody-2 3.79 ± 6% 3.78 ± 7% ~ (p=1.000 n=5+5) _jsonBodyValidation-2 4.97 ± 5% 4.84 ± 2% ~ (p=0.421 n=5+5) _outputHeaders-2 2.17 ± 3% 2.17 ± 6% ~ (p=1.000 n=5+5) _requestResponseMapping-2 4.55 ± 4% 4.31 ± 6% ~ (p=0.095 n=5+5) _validation-2 4.73 ± 3% 4.70 ±15% ~ (p=0.222 n=5+5) _noValidation-2 3.13 ± 4% 3.09 ± 4% ~ (p=0.802 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 2.40 ± 6% 2.34 ± 5% ~ (p=0.222 n=5+5) _ok-2 2.37 ± 1% 2.47 ± 8% +4.46% (p=0.016 n=5+5) _invalidBody-2 3.66 ±10% 3.73 ± 7% ~ (p=0.548 n=5+5) name old 99%:ms new 99%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 3.71 ± 8% 3.72 ±10% ~ (p=1.000 n=5+4) _directGzipHead-2 3.86 ± 2% 3.93 ± 9% ~ (p=0.730 n=4+5) _noDirectGzip-2 15.3 ± 9% 15.1 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-2 59.5 ±10% 64.5 ±15% ~ (p=0.310 n=5+5) _noDirectGzip_decode-2 15.1 ± 6% 15.5 ± 3% ~ (p=0.524 n=5+5) _jsonBody-2 7.15 ±28% 7.02 ±13% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 6.97 ± 8% 7.47 ±13% ~ (p=0.151 n=5+5) _outputHeaders-2 3.81 ±12% 3.96 ± 7% ~ (p=0.548 n=5+5) _requestResponseMapping-2 7.32 ±36% 6.92 ±22% ~ (p=0.690 n=5+5) _validation-2 6.54 ± 8% 7.53 ±16% ~ (p=0.095 n=5+5) _noValidation-2 5.89 ±15% 6.05 ±19% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.90 ± 9% 3.89 ±11% ~ (p=1.000 n=5+5) _directGzipHead-2 5.01 ±89% 4.06 ± 9% ~ (p=0.730 n=5+4) _noDirectGzip-2 15.9 ±21% 15.4 ± 3% ~ (p=0.841 n=5+5) _directGzip_decode-2 66.8 ± 9% 63.5 ±10% ~ (p=0.310 n=5+5) _noDirectGzip_decode-2 16.7 ±31% 15.4 ± 6% ~ (p=1.000 n=5+5) _htmlResponse-2 5.92 ± 6% 6.10 ± 4% ~ (p=0.222 n=5+5) _jsonBodyManual-2 4.45 ± 8% 6.19 ± 3% +39.12% (p=0.008 n=5+5) _jsonBody-2 6.55 ±11% 6.52 ±11% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 8.72 ±19% 7.97 ±18% ~ (p=0.151 n=5+5) _outputHeaders-2 4.57 ± 9% 4.46 ± 8% ~ (p=0.690 n=5+5) _requestResponseMapping-2 7.89 ±19% 7.31 ±23% ~ (p=0.310 n=5+5) _validation-2 7.46 ±13% 7.13 ± 4% ~ (p=0.190 n=5+4) _noValidation-2 5.91 ± 6% 5.92 ± 6% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 3.86 ± 5% 3.89 ± 3% ~ (p=0.841 n=5+5) _ok-2 4.16 ±16% 3.92 ± 6% ~ (p=0.413 n=5+4) _invalidBody-2 6.94 ±12% 6.79 ±18% ~ (p=0.690 n=5+5) name old 99.9%:ms new 99.9%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 7.25 ±30% 10.97 ±99% ~ (p=0.421 n=5+5) _directGzipHead-2 10.8 ±39% 9.4 ±42% ~ (p=0.548 n=5+5) _noDirectGzip-2 19.2 ±24% 18.8 ±10% ~ (p=1.000 n=5+5) _directGzip_decode-2 81.2 ±17% 85.0 ±14% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 20.1 ±10% 20.8 ±17% ~ (p=1.000 n=5+5) _jsonBody-2 12.6 ±20% 10.5 ±27% ~ (p=0.222 n=5+5) _jsonBodyValidation-2 11.5 ±53% 13.7 ±31% ~ (p=0.421 n=5+5) _outputHeaders-2 8.16 ±51% 10.39 ±47% ~ (p=0.222 n=5+5) _requestResponseMapping-2 13.4 ±52% 14.5 ±34% ~ (p=0.421 n=5+5) _validation-2 10.5 ±13% 13.1 ±27% ~ (p=0.056 n=5+5) _noValidation-2 10.1 ±18% 12.0 ±27% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 7.14 ±38% 6.84 ±38% ~ (p=0.690 n=5+5) _directGzipHead-2 9.26 ±49% 12.35 ±57% ~ (p=0.310 n=5+5) _noDirectGzip-2 21.5 ±32% 19.7 ±13% ~ (p=0.548 n=5+5) _directGzip_decode-2 83.2 ±14% 82.4 ±19% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 19.5 ± 3% 19.6 ±19% ~ (p=1.000 n=4+5) _htmlResponse-2 9.20 ±31% 9.68 ±42% ~ (p=0.690 n=5+5) _jsonBodyManual-2 8.81 ±84% 9.23 ±31% ~ (p=0.151 n=5+5) _jsonBody-2 11.9 ±59% 10.3 ±28% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 14.2 ±28% 13.5 ±36% ~ (p=0.690 n=5+5) _outputHeaders-2 8.43 ± 4% 8.96 ±29% ~ (p=0.730 n=4+5) _requestResponseMapping-2 14.6 ±21% 12.1 ±22% ~ (p=0.222 n=5+5) _validation-2 14.1 ±20% 15.9 ±40% ~ (p=0.421 n=5+5) _noValidation-2 10.0 ±25% 9.9 ±20% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 6.16 ±14% 7.05 ±33% ~ (p=0.310 n=5+5) _ok-2 7.39 ±48% 8.66 ±69% ~ (p=0.841 n=5+5) _invalidBody-2 12.2 ±24% 12.1 ±60% ~ (p=0.548 n=5+5) name old B:rcvd/op new B:rcvd/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 630 ± 0% 630 ± 0% ~ (all equal) _directGzipHead-2 174 ± 0% 174 ± 0% ~ (all equal) _noDirectGzip-2 1.03k ± 0% 1.03k ± 0% ~ (all equal) _directGzip_decode-2 630 ± 0% 630 ± 0% ~ (all equal) _noDirectGzip_decode-2 1.03k ± 0% 1.03k ± 0% ~ (all equal) _jsonBody-2 199 ± 0% 199 ± 0% ~ (all equal) _jsonBodyValidation-2 185 ± 0% 185 ± 0% ~ (all equal) _outputHeaders-2 146 ± 0% 146 ± 0% ~ (all equal) _requestResponseMapping-2 94.0 ± 0% 94.0 ± 0% ~ (all equal) _validation-2 168 ± 0% 168 ± 0% ~ (all equal) _noValidation-2 168 ± 0% 168 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 638 ± 0% 638 ± 0% ~ (all equal) _directGzipHead-2 182 ± 0% 182 ± 0% ~ (all equal) _noDirectGzip-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _directGzip_decode-2 638 ± 0% 638 ± 0% ~ (all equal) _noDirectGzip_decode-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _htmlResponse-2 355 ± 0% 355 ± 0% ~ (all equal) _jsonBodyManual-2 207 ± 0% 207 ± 0% ~ (all equal) _jsonBody-2 207 ± 0% 207 ± 0% ~ (all equal) _jsonBodyValidation-2 193 ± 0% 193 ± 0% ~ (all equal) _outputHeaders-2 185 ± 0% 185 ± 0% ~ (all equal) _requestResponseMapping-2 108 ± 0% 108 ± 0% ~ (all equal) _validation-2 176 ± 0% 176 ± 0% ~ (all equal) _noValidation-2 176 ± 0% 176 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 322 ± 0% 322 ± 0% ~ (all equal) _ok-2 344 ± 0% 344 ± 0% ~ (all equal) _invalidBody-2 420 ± 0% 420 ± 0% ~ (all equal) name old B:sent/op new B:sent/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 103 ± 0% 103 ± 0% ~ (all equal) _directGzipHead-2 104 ± 0% 104 ± 0% ~ (all equal) _noDirectGzip-2 117 ± 0% 117 ± 0% ~ (all equal) _directGzip_decode-2 116 ± 0% 116 ± 0% ~ (all equal) _noDirectGzip_decode-2 130 ± 0% 130 ± 0% ~ (all equal) _jsonBody-2 188 ± 0% 188 ± 0% ~ (all equal) _jsonBodyValidation-2 192 ± 0% 192 ± 0% ~ (all equal) _outputHeaders-2 77.0 ± 0% 77.0 ± 0% ~ (all equal) _requestResponseMapping-2 169 ± 0% 169 ± 0% ~ (all equal) _validation-2 170 ± 0% 170 ± 0% ~ (all equal) _noValidation-2 173 ± 0% 173 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 103 ± 0% 103 ± 0% ~ (all equal) _directGzipHead-2 104 ± 0% 104 ± 0% ~ (all equal) _noDirectGzip-2 117 ± 0% 117 ± 0% ~ (all equal) _directGzip_decode-2 116 ± 0% 116 ± 0% ~ (all equal) _noDirectGzip_decode-2 130 ± 0% 130 ± 0% ~ (all equal) _htmlResponse-2 108 ± 0% 108 ± 0% ~ (all equal) _jsonBodyManual-2 195 ± 0% 195 ± 0% ~ (all equal) _jsonBody-2 188 ± 0% 188 ± 0% ~ (all equal) _jsonBodyValidation-2 192 ± 0% 192 ± 0% ~ (all equal) _outputHeaders-2 77.0 ± 0% 77.0 ± 0% ~ (all equal) _requestResponseMapping-2 169 ± 0% 169 ± 0% ~ (all equal) _validation-2 170 ± 0% 170 ± 0% ~ (all equal) _noValidation-2 173 ± 0% 173 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 74.0 ± 0% 74.0 ± 0% ~ (all equal) _ok-2 74.0 ± 0% 74.0 ± 0% ~ (all equal) _invalidBody-2 137 ± 0% 137 ± 0% ~ (all equal) name old rps new rps delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 40.2k ± 2% 38.8k ± 9% ~ (p=0.056 n=5+5) _directGzipHead-2 39.8k ± 1% 39.8k ± 1% ~ (p=0.730 n=4+5) _noDirectGzip-2 7.77k ± 2% 7.77k ± 1% ~ (p=0.690 n=5+5) _directGzip_decode-2 2.13k ± 1% 2.15k ± 2% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 7.78k ± 1% 7.75k ± 1% ~ (p=0.278 n=5+5) _jsonBody-2 22.4k ± 1% 21.6k ± 2% -3.26% (p=0.008 n=5+5) _jsonBodyValidation-2 19.7k ± 2% 19.2k ± 2% -2.82% (p=0.016 n=5+5) _outputHeaders-2 42.6k ± 2% 41.9k ± 2% ~ (p=0.421 n=5+5) _requestResponseMapping-2 22.6k ± 7% 22.6k ± 1% ~ (p=0.310 n=5+5) _validation-2 21.5k ± 1% 21.2k ± 2% ~ (p=0.151 n=5+5) _noValidation-2 28.9k ± 2% 28.7k ± 3% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 39.3k ± 2% 40.0k ± 1% ~ (p=0.056 n=5+5) _directGzipHead-2 38.3k ± 9% 38.3k ±12% ~ (p=0.690 n=5+5) _noDirectGzip-2 7.66k ± 2% 7.69k ± 1% ~ (p=0.690 n=5+5) _directGzip_decode-2 2.17k ± 1% 2.15k ± 1% ~ (p=0.135 n=5+5) _noDirectGzip_decode-2 7.62k ± 6% 7.63k ± 1% ~ (p=0.421 n=5+5) _htmlResponse-2 25.6k ± 2% 24.6k ± 2% -3.94% (p=0.008 n=5+5) _jsonBodyManual-2 35.1k ± 1% 24.5k ± 1% -30.06% (p=0.008 n=5+5) _jsonBody-2 24.4k ± 2% 24.4k ± 1% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 18.5k ± 0% 18.8k ± 2% ~ (p=0.190 n=4+5) _outputHeaders-2 38.4k ± 1% 38.7k ± 2% ~ (p=0.690 n=5+5) _requestResponseMapping-2 21.6k ± 2% 22.4k ± 2% +3.70% (p=0.008 n=5+5) _validation-2 20.4k ± 1% 20.5k ± 8% ~ (p=0.151 n=5+5) _noValidation-2 28.1k ± 1% 28.4k ± 1% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 35.6k ± 2% 36.3k ± 0% +1.91% (p=0.032 n=5+5) _ok-2 35.2k ± 2% 34.6k ±11% ~ (p=0.841 n=5+5) _invalidBody-2 24.9k ± 2% 25.1k ± 2% ~ (p=0.548 n=5+5) name old alloc/op new alloc/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 3.99kB ± 0% 3.99kB ± 0% ~ (p=0.841 n=5+5) _directGzipHead-2 3.99kB ± 0% 3.99kB ± 0% ~ (p=0.762 n=5+5) _noDirectGzip-2 6.75kB ±17% 6.83kB ±10% ~ (p=0.841 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.095 n=5+5) _noDirectGzip_decode-2 5.91kB ±14% 5.86kB ±11% ~ (p=0.841 n=5+5) _jsonBody-2 13.2kB ± 0% 13.2kB ± 0% ~ (p=0.230 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.317 n=5+5) _outputHeaders-2 3.71kB ± 0% 3.71kB ± 0% ~ (p=0.524 n=5+5) _requestResponseMapping-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.722 n=5+5) _validation-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.460 n=5+5) _noValidation-2 7.89kB ± 0% 7.89kB ± 0% ~ (p=0.627 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 4.04kB ± 0% 4.04kB ± 0% ~ (p=0.746 n=5+5) _directGzipHead-2 4.04kB ± 0% 4.04kB ± 0% ~ (p=0.984 n=5+5) _noDirectGzip-2 7.10kB ±23% 6.96kB ±17% ~ (p=0.841 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 5.75kB ± 5% 5.75kB ± 2% ~ (p=0.690 n=5+5) _htmlResponse-2 8.28kB ± 0% 8.29kB ± 0% +0.05% (p=0.024 n=5+5) _jsonBodyManual-2 4.65kB ± 0% 10.38kB ± 0% +123.25% (p=0.008 n=5+5) _jsonBody-2 10.4kB ± 0% 10.4kB ± 0% ~ (p=0.373 n=5+5) _jsonBodyValidation-2 19.1kB ± 0% 19.1kB ± 0% ~ (p=0.667 n=5+5) _outputHeaders-2 4.36kB ± 0% 4.36kB ± 0% ~ (p=0.571 n=5+5) _requestResponseMapping-2 16.8kB ± 0% 16.8kB ± 0% ~ (p=0.556 n=5+5) _validation-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.278 n=5+5) _noValidation-2 7.95kB ± 0% 7.95kB ± 0% ~ (p=0.214 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.89kB ± 0% 4.89kB ± 0% ~ (p=0.325 n=5+5) _ok-2 4.79kB ± 0% 4.79kB ± 0% ~ (p=0.171 n=4+4) _invalidBody-2 8.63kB ± 0% 8.63kB ± 0% ~ (p=0.314 n=4+4) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 43.0 ± 0% 43.0 ± 0% ~ (all equal) _directGzipHead-2 43.0 ± 0% 43.0 ± 0% ~ (all equal) _noDirectGzip-2 50.4 ± 3% 50.6 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 503 ± 0% 502 ± 0% -0.28% (p=0.000 n=5+4) _noDirectGzip_decode-2 51.0 ± 0% 51.0 ± 0% ~ (all equal) _jsonBody-2 130 ± 0% 130 ± 0% ~ (all equal) _jsonBodyValidation-2 186 ± 0% 186 ± 0% ~ (all equal) _outputHeaders-2 37.0 ± 0% 37.0 ± 0% ~ (all equal) _requestResponseMapping-2 126 ± 0% 126 ± 0% ~ (all equal) _validation-2 155 ± 0% 155 ± 0% ~ (all equal) _noValidation-2 92.0 ± 0% 92.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 45.0 ± 0% 45.0 ± 0% ~ (all equal) _directGzipHead-2 45.0 ± 0% 45.0 ± 0% ~ (all equal) _noDirectGzip-2 52.6 ± 3% 52.6 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 505 ± 0% 505 ± 0% ~ (p=0.556 n=4+5) _noDirectGzip_decode-2 53.0 ± 0% 53.0 ± 0% ~ (all equal) _htmlResponse-2 146 ± 0% 146 ± 0% ~ (all equal) _jsonBodyManual-2 51.0 ± 0% 102.0 ± 0% +100.00% (p=0.008 n=5+5) _jsonBody-2 102 ± 0% 102 ± 0% ~ (all equal) _jsonBodyValidation-2 188 ± 0% 188 ± 0% ~ (all equal) _outputHeaders-2 46.0 ± 0% 46.0 ± 0% ~ (all equal) _requestResponseMapping-2 128 ± 0% 128 ± 0% ~ (all equal) _validation-2 157 ± 0% 157 ± 0% ~ (all equal) _noValidation-2 94.0 ± 0% 94.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 54.0 ± 0% 54.0 ± 0% ~ (all equal) _ok-2 50.0 ± 0% 50.0 ± 0% ~ (all equal) _invalidBody-2 99.0 ± 0% 99.0 ± 0% ~ (all equal) ```