swaggest / rest

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

Fix handling of embedded response headers #140

Closed vearutop closed 1 year ago

vearutop commented 1 year ago

Fixes #139.

github-actions[bot] commented 1 year ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 106 7609 (+14) 5537 (+11) 498 1574 (+3) 927 (+2) 183.8K (+193B)
Go (test) 48 5269 (+10) 4035 (+9) 185 1049 (+1) 179 147.2K (+221B)
JSON 3 1517 (+2) 1517 (+2) 0 0 0 62.6K (+140B)
github-actions[bot] commented 1 year ago

Go API Changes

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

Unit Test Coverage

total: (statements) 83.4% changed lines: (statements) 100.0%

Coverage of changed lines | File | Function | Coverage | |------------------------|---------------------|----------| | Total | | 100.0% | | response/encoder.go | | 100.0% | | response/encoder.go:57 | setupHeadersEncoder | 100.0% | | response/encoder.go:97 | setupCookiesEncoder | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |----------------------------------------------|---------------------|---------------|------------------| | Total | | 83.3% | 83.4% (+0.1%) | | github.com/swaggest/rest/response/encoder.go | setupCookiesEncoder | 84.4% | 85.3% (+0.9%) | | github.com/swaggest/rest/response/encoder.go | setupHeadersEncoder | 73.7% | 76.2% (+2.5%) |
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.34µs ± 2% 1.33µs ± 0% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 659ns ± 0% 662ns ± 1% ~ (p=0.310 n=5+5) DecoderFunc_Decode-2 1.94µs ± 0% 1.92µs ± 0% -0.97% (p=0.016 n=4+5) Decoder_Decode_json-2 22.9µs ± 1% 23.0µs ± 1% ~ (p=0.699 n=6+6) Decoder_Decode_queryObject-2 5.14µs ± 4% 5.12µs ± 0% ~ (p=0.420 n=6+6) Decoder_Decode_jsonParam-2 2.12µs ± 0% 2.12µs ± 0% ~ (p=0.606 n=6+5) DecoderFactory_SetDecoderFunc-2 1.67µs ± 0% 1.66µs ± 0% -0.59% (p=0.004 n=6+5) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.4µs ± 0% 11.5µs ± 1% +1.27% (p=0.004 n=5+6) Middleware_control-2 3.23µs ± 2% 3.22µs ± 1% ~ (p=0.429 n=6+5) 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.14kB ± 4% 1.18kB ± 6% +3.48% (p=0.037 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.33µs ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 662ns ± 1% DecoderFunc_Decode-2 1.92µs ± 0% Decoder_Decode_json-2 23.0µs ± 1% Decoder_Decode_queryObject-2 5.12µs ± 0% Decoder_Decode_jsonParam-2 2.12µs ± 0% DecoderFactory_SetDecoderFunc-2 1.66µs ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.5µs ± 1% Middleware_control-2 3.22µs ± 1% 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.18kB ± 6% 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 22.5µs ±12% 22.8µs ±14% ~ (p=0.310 n=5+5) _directGzipHead-2 21.6µs ± 2% 21.7µs ± 2% ~ (p=0.841 n=5+5) _noDirectGzip-2 133µs ± 2% 132µs ± 1% ~ (p=0.421 n=5+5) _directGzip_decode-2 480µs ± 1% 477µs ± 1% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 134µs ± 1% 132µs ± 1% -1.05% (p=0.032 n=5+5) _jsonBody-2 44.7µs ± 3% 44.7µs ± 1% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 53.3µs ± 2% 53.7µs ± 2% ~ (p=0.222 n=5+5) _outputHeaders-2 22.1µs ± 3% 22.9µs ± 4% ~ (p=0.056 n=5+5) _requestResponseMapping-2 46.3µs ± 2% 46.6µs ± 4% ~ (p=0.548 n=5+5) _validation-2 50.1µs ± 1% 49.8µs ± 2% ~ (p=0.421 n=5+5) _noValidation-2 34.6µs ± 1% 34.0µs ± 1% -1.89% (p=0.016 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 23.1µs ±16% 22.0µs ± 1% ~ (p=0.841 n=5+5) _directGzipHead-2 22.6µs ± 9% 22.0µs ± 0% ~ (p=0.730 n=5+4) _noDirectGzip-2 120µs ± 1% 121µs ± 1% ~ (p=0.222 n=5+5) _directGzip_decode-2 464µs ± 2% 461µs ± 2% ~ (p=0.841 n=5+5) _noDirectGzip_decode-2 121µs ± 0% 121µs ± 1% ~ (p=0.095 n=5+5) _htmlResponse-2 39.5µs ± 3% 38.9µs ± 1% ~ (p=0.151 n=5+5) _jsonBodyManual-2 27.3µs ± 1% 27.2µs ± 2% ~ (p=0.690 n=5+5) _jsonBody-2 41.1µs ± 2% 41.0µs ± 2% ~ (p=1.000 n=5+5) _jsonBodyValidation-2 55.5µs ± 1% 54.9µs ± 2% ~ (p=0.222 n=5+5) _outputHeaders-2 24.4µs ± 2% 24.9µs ± 1% ~ (p=0.095 n=5+5) _requestResponseMapping-2 46.8µs ± 2% 46.0µs ± 1% ~ (p=0.056 n=5+5) _validation-2 49.5µs ± 5% 50.9µs ± 5% ~ (p=0.151 n=5+5) _noValidation-2 35.0µs ± 1% 36.5µs ± 3% +4.31% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 24.7µs ± 3% 25.9µs ±17% ~ (p=0.690 n=5+5) _ok-2 24.4µs ± 1% 24.6µs ± 2% ~ (p=0.421 n=5+5) _invalidBody-2 36.7µs ± 2% 36.7µs ± 3% ~ (p=0.841 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.06 ± 6% 1.06 ± 6% ~ (p=0.635 n=5+5) _directGzipHead-2 1.04 ± 3% 1.02 ±11% ~ (p=0.310 n=5+5) _noDirectGzip-2 6.44 ± 4% 6.40 ± 6% ~ (p=0.841 n=5+5) _directGzip_decode-2 18.6 ± 6% 18.6 ±10% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 6.53 ± 3% 6.43 ± 5% ~ (p=0.548 n=5+5) _jsonBody-2 2.10 ± 5% 2.05 ± 6% ~ (p=0.643 n=5+5) _jsonBodyValidation-2 2.56 ± 7% 2.48 ± 5% ~ (p=0.222 n=5+5) _outputHeaders-2 1.01 ± 7% 1.07 ± 7% ~ (p=0.151 n=5+5) _requestResponseMapping-2 2.02 ± 8% 2.09 ± 3% ~ (p=0.310 n=5+5) _validation-2 2.33 ± 3% 2.24 ± 6% ~ (p=0.095 n=5+5) _noValidation-2 1.56 ± 6% 1.52 ± 5% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 1.06 ± 6% 1.03 ± 3% ~ (p=0.421 n=5+5) _directGzipHead-2 1.06 ± 6% 1.05 ± 5% ~ (p=0.841 n=5+5) _noDirectGzip-2 5.78 ± 7% 5.83 ± 5% ~ (p=0.841 n=5+5) _directGzip_decode-2 17.6 ± 6% 18.1 ± 5% ~ (p=0.310 n=5+5) _noDirectGzip_decode-2 5.94 ± 4% 5.81 ± 7% ~ (p=0.310 n=5+5) _htmlResponse-2 1.77 ± 8% 1.80 ± 3% ~ (p=0.222 n=5+5) _jsonBodyManual-2 1.27 ± 3% 1.26 ± 4% ~ (p=0.548 n=5+5) _jsonBody-2 1.86 ± 5% 1.81 ± 9% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 2.56 ± 3% 2.50 ± 5% ~ (p=0.421 n=5+5) _outputHeaders-2 1.14 ± 2% 1.17 ± 2% +3.17% (p=0.048 n=5+5) _requestResponseMapping-2 2.13 ± 4% 2.03 ± 3% -4.55% (p=0.016 n=5+5) _validation-2 2.33 ± 7% 2.32 ± 4% ~ (p=1.000 n=5+5) _noValidation-2 1.55 ± 6% 1.59 ± 7% ~ (p=0.246 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 1.16 ± 4% 1.19 ± 4% ~ (p=0.310 n=5+5) _ok-2 1.13 ± 5% 1.21 ± 4% +6.70% (p=0.016 n=5+5) _invalidBody-2 1.58 ± 4% 1.61 ± 5% ~ (p=0.548 n=5+5) name old 90%:ms new 90%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 1.88 ± 8% 1.94 ±12% ~ (p=0.310 n=5+5) _directGzipHead-2 1.85 ±10% 1.86 ± 4% ~ (p=0.690 n=5+5) _noDirectGzip-2 11.4 ± 3% 11.4 ± 5% ~ (p=0.802 n=5+5) _directGzip_decode-2 40.2 ± 5% 40.3 ± 9% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 11.4 ± 2% 11.5 ± 4% ~ (p=0.690 n=5+5) _jsonBody-2 3.95 ± 3% 4.03 ± 5% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 4.58 ± 4% 4.72 ± 3% ~ (p=0.222 n=5+5) _outputHeaders-2 1.82 ± 4% 1.93 ± 4% +5.85% (p=0.032 n=5+5) _requestResponseMapping-2 4.11 ± 3% 4.23 ± 5% ~ (p=0.151 n=5+5) _validation-2 4.45 ± 4% 4.39 ± 4% ~ (p=0.690 n=5+5) _noValidation-2 3.22 ± 7% 3.32 ± 4% ~ (p=0.310 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 1.95 ± 9% 1.88 ± 4% ~ (p=1.000 n=5+5) _directGzipHead-2 1.90 ± 5% 1.87 ± 5% ~ (p=0.587 n=5+5) _noDirectGzip-2 10.6 ± 6% 10.6 ± 5% ~ (p=1.000 n=5+5) _directGzip_decode-2 39.9 ± 4% 39.2 ± 4% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 10.5 ± 3% 10.5 ± 4% ~ (p=0.897 n=5+5) _htmlResponse-2 3.62 ± 4% 3.45 ± 3% ~ (p=0.056 n=5+5) _jsonBodyManual-2 2.35 ± 3% 2.34 ± 5% ~ (p=0.841 n=5+5) _jsonBody-2 3.79 ± 4% 3.74 ± 4% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 4.88 ± 4% 4.99 ± 5% ~ (p=0.690 n=5+5) _outputHeaders-2 2.08 ± 6% 2.10 ± 7% ~ (p=0.690 n=5+5) _requestResponseMapping-2 4.23 ± 4% 4.12 ± 6% ~ (p=0.222 n=5+5) _validation-2 4.38 ± 9% 4.50 ± 6% ~ (p=0.222 n=5+5) _noValidation-2 3.23 ± 2% 3.60 ± 4% +11.44% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 2.13 ± 6% 2.12 ± 5% ~ (p=1.000 n=5+5) _ok-2 2.10 ± 5% 2.13 ± 3% ~ (p=0.548 n=5+5) _invalidBody-2 3.45 ± 3% 3.50 ± 6% ~ (p=0.690 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.12 ±13% 3.17 ± 4% ~ (p=0.343 n=4+4) _directGzipHead-2 3.15 ± 7% 3.16 ± 6% ~ (p=0.690 n=5+5) _noDirectGzip-2 16.2 ±12% 15.6 ± 3% ~ (p=0.460 n=5+5) _directGzip_decode-2 70.2 ±12% 64.1 ±10% ~ (p=0.095 n=5+5) _noDirectGzip_decode-2 15.9 ± 6% 15.6 ± 5% ~ (p=0.548 n=5+5) _jsonBody-2 5.89 ±20% 5.67 ±11% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 7.12 ±20% 8.02 ±16% ~ (p=0.222 n=5+5) _outputHeaders-2 3.92 ±46% 4.29 ±20% ~ (p=0.222 n=5+5) _requestResponseMapping-2 9.42 ± 7% 9.01 ±20% ~ (p=0.841 n=5+5) _validation-2 9.13 ±21% 9.39 ±27% ~ (p=0.690 n=5+5) _noValidation-2 5.39 ± 6% 5.43 ±10% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 4.42 ±106% 3.07 ± 3% ~ (p=0.548 n=5+5) _directGzipHead-2 3.94 ±70% 3.22 ± 4% ~ (p=0.730 n=5+4) _noDirectGzip-2 14.6 ± 3% 14.1 ± 6% ~ (p=0.310 n=5+5) _directGzip_decode-2 66.5 ± 8% 66.1 ± 4% ~ (p=0.841 n=5+5) _noDirectGzip_decode-2 14.2 ± 5% 13.9 ± 7% ~ (p=0.841 n=5+5) _htmlResponse-2 6.31 ± 9% 5.98 ±14% ~ (p=0.222 n=5+5) _jsonBodyManual-2 4.29 ±15% 4.23 ± 6% ~ (p=0.841 n=5+5) _jsonBody-2 6.87 ±13% 6.68 ±14% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 9.29 ±19% 9.04 ±16% ~ (p=1.000 n=5+5) _outputHeaders-2 4.07 ±13% 4.07 ±10% ~ (p=1.000 n=5+5) _requestResponseMapping-2 7.01 ±27% 6.40 ±14% ~ (p=0.421 n=5+5) _validation-2 6.59 ± 7% 7.23 ± 6% +9.59% (p=0.032 n=5+5) _noValidation-2 5.99 ± 8% 6.21 ±13% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 3.35 ± 6% 3.36 ± 5% ~ (p=0.905 n=5+4) _ok-2 3.31 ± 6% 3.42 ± 5% ~ (p=0.222 n=5+5) _invalidBody-2 6.01 ±14% 6.01 ±25% ~ (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.78 ±96% 9.28 ±42% ~ (p=0.421 n=5+5) _directGzipHead-2 6.19 ±24% 7.10 ±47% ~ (p=0.690 n=5+5) _noDirectGzip-2 20.1 ± 8% 21.6 ±29% ~ (p=0.841 n=5+5) _directGzip_decode-2 89.5 ±14% 89.3 ±14% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 19.1 ± 9% 19.6 ±25% ~ (p=1.000 n=5+5) _jsonBody-2 8.81 ±52% 9.29 ±18% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 11.7 ±23% 13.8 ±31% ~ (p=0.151 n=5+5) _outputHeaders-2 9.66 ±51% 9.44 ±56% ~ (p=0.841 n=5+5) _requestResponseMapping-2 13.2 ±10% 13.7 ±11% ~ (p=0.841 n=5+5) _validation-2 15.1 ±11% 14.7 ±12% ~ (p=0.579 n=5+5) _noValidation-2 10.6 ±12% 11.0 ±32% ~ (p=0.452 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 8.64 ±78% 5.42 ±34% ~ (p=0.222 n=5+5) _directGzipHead-2 8.46 ±62% 8.14 ±74% ~ (p=0.690 n=5+5) _noDirectGzip-2 18.4 ± 5% 17.6 ± 8% ~ (p=0.421 n=5+5) _directGzip_decode-2 85.7 ±10% 91.0 ±16% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 19.9 ±20% 17.1 ±11% ~ (p=0.095 n=5+5) _htmlResponse-2 14.0 ±30% 12.1 ±54% ~ (p=0.310 n=5+5) _jsonBodyManual-2 10.2 ±34% 10.8 ±39% ~ (p=0.841 n=5+5) _jsonBody-2 13.5 ±34% 13.6 ±34% ~ (p=1.000 n=5+5) _jsonBodyValidation-2 15.9 ±25% 13.9 ±17% ~ (p=0.310 n=5+5) _outputHeaders-2 11.0 ±27% 9.4 ±28% ~ (p=0.421 n=5+5) _requestResponseMapping-2 13.4 ±16% 11.4 ±27% ~ (p=0.095 n=5+5) _validation-2 10.3 ±49% 13.8 ±19% ~ (p=0.056 n=5+5) _noValidation-2 11.4 ±11% 12.2 ±14% ~ (p=0.310 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 8.46 ±84% 8.64 ±103% ~ (p=1.000 n=5+5) _ok-2 6.42 ±38% 6.40 ±29% ~ (p=1.000 n=5+5) _invalidBody-2 8.61 ±31% 10.25 ±66% ~ (p=0.421 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% 197 ± 0% +6.49% (p=0.008 n=5+5) _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% ~ (p=1.000 n=5+5) _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 44.7k ±11% 44.0k ±13% ~ (p=0.310 n=5+5) _directGzipHead-2 46.3k ± 2% 46.1k ± 2% ~ (p=0.841 n=5+5) _noDirectGzip-2 7.54k ± 2% 7.57k ± 1% ~ (p=0.341 n=5+5) _directGzip_decode-2 2.08k ± 1% 2.10k ± 1% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 7.48k ± 1% 7.56k ± 1% +1.06% (p=0.032 n=5+5) _jsonBody-2 22.4k ± 3% 22.4k ± 1% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 18.8k ± 2% 18.6k ± 2% ~ (p=0.222 n=5+5) _outputHeaders-2 45.2k ± 3% 43.6k ± 4% ~ (p=0.056 n=5+5) _requestResponseMapping-2 21.6k ± 2% 21.5k ± 4% ~ (p=0.548 n=5+5) _validation-2 20.0k ± 1% 20.0k ± 2% ~ (p=0.421 n=5+5) _noValidation-2 28.9k ± 1% 29.4k ± 1% +1.92% (p=0.016 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 43.5k ±14% 45.5k ± 1% ~ (p=0.841 n=5+5) _directGzipHead-2 44.3k ± 8% 45.4k ± 0% ~ (p=0.730 n=5+4) _noDirectGzip-2 8.33k ± 1% 8.28k ± 1% ~ (p=0.222 n=5+5) _directGzip_decode-2 2.16k ± 2% 2.17k ± 2% ~ (p=0.738 n=5+5) _noDirectGzip_decode-2 8.23k ± 0% 8.29k ± 1% ~ (p=0.095 n=5+5) _htmlResponse-2 25.3k ± 3% 25.7k ± 1% ~ (p=0.151 n=5+5) _jsonBodyManual-2 36.6k ± 1% 36.7k ± 2% ~ (p=0.690 n=5+5) _jsonBody-2 24.3k ± 2% 24.4k ± 2% ~ (p=1.000 n=5+5) _jsonBodyValidation-2 18.0k ± 1% 18.2k ± 2% ~ (p=0.222 n=5+5) _outputHeaders-2 40.9k ± 2% 40.2k ± 1% ~ (p=0.095 n=5+5) _requestResponseMapping-2 21.4k ± 2% 21.7k ± 1% ~ (p=0.056 n=5+5) _validation-2 20.2k ± 4% 19.7k ± 5% ~ (p=0.151 n=5+5) _noValidation-2 28.6k ± 1% 27.4k ± 3% -4.10% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 40.5k ± 3% 38.9k ±15% ~ (p=0.548 n=5+5) _ok-2 41.0k ± 1% 40.7k ± 2% ~ (p=0.421 n=5+5) _invalidBody-2 27.2k ± 1% 27.3k ± 3% ~ (p=0.841 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.86kB ± 0% 3.86kB ± 0% ~ (p=0.754 n=5+5) _directGzipHead-2 3.86kB ± 0% 3.86kB ± 0% ~ (p=0.190 n=5+5) _noDirectGzip-2 6.87kB ±19% 6.68kB ±15% ~ (p=0.841 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 5.96kB ±12% 5.88kB ±15% ~ (p=1.000 n=5+5) _jsonBody-2 13.1kB ± 0% 13.1kB ± 0% ~ (p=0.571 n=5+5) _jsonBodyValidation-2 18.9kB ± 0% 18.9kB ± 0% ~ (p=0.103 n=5+5) _outputHeaders-2 3.58kB ± 0% 3.58kB ± 0% ~ (p=0.381 n=5+5) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.659 n=5+5) _validation-2 16.5kB ± 0% 16.5kB ± 0% ~ (p=0.286 n=5+5) _noValidation-2 7.75kB ± 0% 7.75kB ± 0% -0.05% (p=0.016 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.89kB ± 0% 3.89kB ± 0% ~ (p=0.135 n=5+5) _directGzipHead-2 3.89kB ± 0% 3.89kB ± 0% ~ (p=0.571 n=5+5) _noDirectGzip-2 6.78kB ±16% 6.75kB ±17% ~ (p=0.841 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 5.80kB ± 5% 5.89kB ± 5% ~ (p=0.548 n=5+5) _htmlResponse-2 8.04kB ± 0% 8.04kB ± 0% ~ (p=0.746 n=5+5) _jsonBodyManual-2 4.50kB ± 0% 4.50kB ± 0% ~ (p=0.151 n=5+5) _jsonBody-2 10.2kB ± 0% 10.2kB ± 0% ~ (p=0.460 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=1.000 n=5+5) _outputHeaders-2 4.22kB ± 0% 4.33kB ± 0% +2.54% (p=0.008 n=5+5) _requestResponseMapping-2 16.7kB ± 0% 16.6kB ± 0% ~ (p=0.222 n=5+5) _validation-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.643 n=5+5) _noValidation-2 7.81kB ± 0% 7.81kB ± 0% ~ (p=0.754 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.64kB ± 0% 4.64kB ± 0% ~ (p=1.000 n=5+5) _ok-2 4.55kB ± 0% 4.55kB ± 0% ~ (p=1.000 n=4+4) _invalidBody-2 8.26kB ± 0% 8.26kB ± 0% ~ (p=1.000 n=4+4) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 42.0 ± 0% 42.0 ± 0% ~ (all equal) _directGzipHead-2 42.0 ± 0% 42.0 ± 0% ~ (all equal) _noDirectGzip-2 49.6 ± 3% 49.6 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 504 ± 0% 504 ± 0% ~ (p=0.810 n=5+5) _noDirectGzip_decode-2 50.0 ± 0% 50.0 ± 0% ~ (all equal) _jsonBody-2 128 ± 0% 128 ± 0% ~ (all equal) _jsonBodyValidation-2 185 ± 0% 185 ± 0% ~ (all equal) _outputHeaders-2 36.0 ± 0% 36.0 ± 0% ~ (all equal) _requestResponseMapping-2 124 ± 0% 124 ± 0% ~ (all equal) _validation-2 154 ± 0% 154 ± 0% ~ (all equal) _noValidation-2 91.0 ± 0% 91.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 44.0 ± 0% 44.0 ± 0% ~ (all equal) _directGzipHead-2 44.0 ± 0% 44.0 ± 0% ~ (all equal) _noDirectGzip-2 51.4 ± 3% 51.4 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 506 ± 0% 505 ± 0% ~ (p=0.365 n=5+5) _noDirectGzip_decode-2 52.0 ± 0% 52.0 ± 0% ~ (all equal) _htmlResponse-2 145 ± 0% 145 ± 0% ~ (all equal) _jsonBodyManual-2 49.0 ± 0% 49.0 ± 0% ~ (all equal) _jsonBody-2 100 ± 0% 100 ± 0% ~ (all equal) _jsonBodyValidation-2 187 ± 0% 187 ± 0% ~ (all equal) _outputHeaders-2 45.0 ± 0% 55.0 ± 0% +22.22% (p=0.008 n=5+5) _requestResponseMapping-2 126 ± 0% 126 ± 0% ~ (all equal) _validation-2 156 ± 0% 156 ± 0% ~ (all equal) _noValidation-2 93.0 ± 0% 93.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 53.0 ± 0% 53.0 ± 0% ~ (all equal) _ok-2 49.0 ± 0% 49.0 ± 0% ~ (all equal) _invalidBody-2 97.0 ± 0% 97.0 ± 0% ~ (all equal) ```