Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for error responses with custom descriptions #184

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

vearutop
Copy link
Member

@vearutop vearutop commented Dec 7, 2023

Can be done with status.WithDescription, for example:

u.SetExpectedErrors(status.InvalidArgument, anotherErr{}, status.FailedPrecondition,
		status.WithDescription(status.AlreadyExists, "Response with custom description."))

Copy link

github-actions bot commented Dec 7, 2023

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 112 8509 (+21) 6135 (+17) 637 1737 (+4) 1017 (+4) 207K (+523B)
Go (test) 54 6371 4877 295 1199 188 175.4K (-120B)
JSON 3 1856 1856 0 0 0 71.5K (+25B)
YAML 10 739 (+1) 634 (+1) 46 59 0 23.2K (+22B)

Copy link

github-actions bot commented Dec 7, 2023

Go API Changes

# summary
Inferred base version: v0.2.59
Suggested version: v0.3.0

Copy link

github-actions bot commented Dec 7, 2023

Unit Test Coverage

total: (statements) 81.0%
changed lines: (statements) 84.6%, coverage is less than 90.0%, consider testing the changes more thoroughly

Coverage of changed lines
File Function Coverage
Total 84.6%
openapi/collector.go 84.6%
openapi/collector.go:427 processOCExpectedErrors 94.7%
openapi/collector.go:413 setOCJSONResponse 75.0%
Coverage diff with base branch
File Function Base Coverage Current Coverage
Total 81.1% 81.0% (-0.1%)
openapi/collector.go processOCExpectedErrors 93.3% 90.9% (-2.4%)
openapi/collector.go setOCJSONResponse 100.0% 83.3% (-16.7%)

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (62a510e) 76.09% compared to head (ba64098) 76.00%.

Files Patch % Lines
openapi/collector.go 69.23% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #184      +/-   ##
==========================================
- Coverage   76.09%   76.00%   -0.10%     
==========================================
  Files          30       30              
  Lines        1690     1700      +10     
==========================================
+ Hits         1286     1292       +6     
- Misses        293      295       +2     
- Partials      111      113       +2     
Flag Coverage Δ
unittests 76.00% <69.23%> (-0.10%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Dec 7, 2023

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-4    1.12µs ± 0%    1.11µs ± 1%    ~     (p=0.190 n=6+6)
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                           563ns ± 0%     550ns ± 1%  -2.44%  (p=0.008 n=5+5)
DecoderFunc_Decode-4                      1.58µs ± 2%    1.54µs ± 1%  -2.33%  (p=0.002 n=6+6)
Decoder_Decode_json-4                     18.0µs ± 0%    18.1µs ± 0%  +0.40%  (p=0.040 n=5+5)
Decoder_Decode_queryObject-4              4.04µs ± 0%    3.96µs ± 0%  -1.93%  (p=0.002 n=6+6)
Decoder_Decode_jsonParam-4                1.49µs ± 1%    1.47µs ± 0%  -1.01%  (p=0.004 n=6+5)
DecoderFactory_SetDecoderFunc-4           1.34µs ± 0%    1.33µs ± 1%  -1.28%  (p=0.004 n=5+6)
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                              8.49µs ± 2%    8.51µs ± 2%    ~     (p=0.818 n=6+6)
Middleware_control-4                      2.78µs ± 1%    2.81µs ± 0%  +1.25%  (p=0.002 n=6+6)

name                                    old alloc/op   new alloc/op   delta
pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64
RequestValidator_ValidateRequestData-4    2.46kB ± 0%    2.46kB ± 0%    ~     (all equal)
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                            440B ± 0%      440B ± 0%    ~     (all equal)
DecoderFunc_Decode-4                      1.51kB ± 0%    1.51kB ± 0%    ~     (all equal)
Decoder_Decode_json-4                     12.2kB ± 0%    12.2kB ± 0%    ~     (p=0.364 n=5+6)
Decoder_Decode_queryObject-4              2.00kB ± 0%    2.00kB ± 0%    ~     (all equal)
Decoder_Decode_jsonParam-4                  736B ± 0%      736B ± 0%    ~     (all equal)
DecoderFactory_SetDecoderFunc-4           1.02kB ± 0%    1.02kB ± 0%    ~     (all equal)
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                              1.27kB ± 2%    1.25kB ± 4%    ~     (p=0.260 n=5+6)
Middleware_control-4                      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-4      8.00 ± 0%      8.00 ± 0%    ~     (all equal)
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                            4.00 ± 0%      4.00 ± 0%    ~     (all equal)
DecoderFunc_Decode-4                        12.0 ± 0%      12.0 ± 0%    ~     (all equal)
Decoder_Decode_json-4                        177 ± 0%       177 ± 0%    ~     (all equal)
Decoder_Decode_queryObject-4                36.0 ± 0%      36.0 ± 0%    ~     (all equal)
Decoder_Decode_jsonParam-4                  13.0 ± 0%      13.0 ± 0%    ~     (all equal)
DecoderFactory_SetDecoderFunc-4             16.0 ± 0%      16.0 ± 0%    ~     (all equal)
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                                11.0 ± 0%      11.0 ± 0%    ~     (all equal)
Middleware_control-4                        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-4  1.11µs ± 1%
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                         550ns ± 1%
DecoderFunc_Decode-4                    1.54µs ± 1%
Decoder_Decode_json-4                   18.1µs ± 0%
Decoder_Decode_queryObject-4            3.96µs ± 0%
Decoder_Decode_jsonParam-4              1.47µs ± 0%
DecoderFactory_SetDecoderFunc-4         1.33µs ± 1%
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                            8.51µs ± 2%
Middleware_control-4                    2.81µs ± 0%

name                                    alloc/op
pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64
RequestValidator_ValidateRequestData-4  2.46kB ± 0%
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                          440B ± 0%
DecoderFunc_Decode-4                    1.51kB ± 0%
Decoder_Decode_json-4                   12.2kB ± 0%
Decoder_Decode_queryObject-4            2.00kB ± 0%
Decoder_Decode_jsonParam-4                736B ± 0%
DecoderFactory_SetDecoderFunc-4         1.02kB ± 0%
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                            1.25kB ± 4%
Middleware_control-4                    11.2kB ± 0%

name                                    allocs/op
pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64
RequestValidator_ValidateRequestData-4    8.00 ± 0%
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                          4.00 ± 0%
DecoderFunc_Decode-4                      12.0 ± 0%
Decoder_Decode_json-4                      177 ± 0%
Decoder_Decode_queryObject-4              36.0 ± 0%
Decoder_Decode_jsonParam-4                13.0 ± 0%
DecoderFactory_SetDecoderFunc-4           16.0 ± 0%
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                              11.0 ± 0%
Middleware_control-4                      9.00 ± 0%

Copy link

github-actions bot commented Dec 7, 2023

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-4                16.1µs ± 1%    16.2µs ± 2%     ~     (p=0.421 n=5+5)
_directGzipHead-4            16.0µs ± 1%    16.0µs ± 1%     ~     (p=0.413 n=5+4)
_noDirectGzip-4               103µs ± 1%     102µs ± 1%     ~     (p=0.690 n=5+5)
_directGzip_decode-4          336µs ± 1%     336µs ± 0%     ~     (p=0.841 n=5+5)
_noDirectGzip_decode-4        104µs ± 4%     103µs ± 1%     ~     (p=0.421 n=5+5)
_jsonBody-4                  34.2µs ± 2%    34.1µs ± 1%     ~     (p=0.690 n=5+5)
_jsonBodyValidation-4        38.8µs ± 1%    38.8µs ± 1%     ~     (p=0.841 n=5+5)
_outputHeaders-4             16.7µs ± 1%    16.6µs ± 1%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4    33.2µs ± 2%    33.5µs ± 0%     ~     (p=0.151 n=5+5)
_validation-4                35.5µs ± 1%    36.2µs ± 1%     ~     (p=0.056 n=5+5)
_noValidation-4              25.5µs ± 2%    25.6µs ± 1%     ~     (p=0.690 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                16.5µs ± 0%    16.6µs ± 4%     ~     (p=0.905 n=4+5)
_directGzipHead-4            16.5µs ± 2%    16.6µs ± 9%     ~     (p=0.310 n=5+5)
_noDirectGzip-4              92.1µs ± 1%    92.2µs ± 1%     ~     (p=0.841 n=5+5)
_directGzip_decode-4          323µs ± 1%     322µs ± 1%     ~     (p=0.690 n=5+5)
_noDirectGzip_decode-4       92.5µs ± 1%    92.5µs ± 1%     ~     (p=1.000 n=5+5)
_htmlResponse-4              29.2µs ± 0%    29.2µs ± 1%     ~     (p=0.548 n=5+5)
_jsonBodyManual-4            20.7µs ± 1%    20.5µs ± 1%     ~     (p=0.056 n=5+5)
_jsonBody-4                  30.5µs ± 1%    30.5µs ± 1%     ~     (p=0.548 n=5+5)
_jsonBodyValidation-4        39.0µs ± 2%    39.2µs ± 1%     ~     (p=0.690 n=5+5)
_outputHeaders-4             28.4µs ± 1%    28.3µs ± 0%     ~     (p=1.000 n=5+5)
_requestResponseMapping-4    33.5µs ± 3%    33.1µs ± 2%     ~     (p=0.421 n=5+5)
_validation-4                35.5µs ± 1%    35.6µs ± 1%     ~     (p=0.286 n=4+5)
_noValidation-4              25.4µs ± 1%    25.5µs ± 1%     ~     (p=0.310 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4               18.1µs ± 0%    18.8µs ± 9%   +3.62%  (p=0.016 n=4+5)
_ok-4                        18.2µs ± 0%    18.3µs ± 1%     ~     (p=0.690 n=5+5)
_invalidBody-4               26.6µs ± 3%    26.5µs ± 4%     ~     (p=0.690 n=5+5)

name                       old 50%:ms     new 50%:ms     delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-4                  0.71 ± 5%      0.71 ± 5%     ~     (p=0.794 n=5+5)
_directGzipHead-4              0.73 ± 5%      0.72 ± 4%     ~     (p=0.421 n=5+5)
_noDirectGzip-4                4.62 ± 4%      4.58 ± 2%     ~     (p=0.548 n=5+5)
_directGzip_decode-4           12.3 ± 5%      12.3 ± 8%     ~     (p=1.000 n=5+5)
_noDirectGzip_decode-4         4.71 ± 6%      4.77 ± 5%     ~     (p=0.841 n=5+5)
_jsonBody-4                    1.39 ± 3%      1.42 ± 3%     ~     (p=0.095 n=5+5)
_jsonBodyValidation-4          1.61 ± 6%      1.65 ± 7%     ~     (p=0.690 n=5+5)
_outputHeaders-4               0.72 ± 6%      0.74 ± 6%     ~     (p=0.690 n=5+5)
_requestResponseMapping-4      1.34 ± 8%      1.36 ± 6%     ~     (p=0.841 n=5+5)
_validation-4                  1.43 ± 2%      1.44 ± 6%     ~     (p=0.952 n=5+5)
_noValidation-4                1.06 ± 4%      1.06 ± 6%     ~     (p=1.000 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  0.73 ± 4%      0.72 ± 3%     ~     (p=0.548 n=5+5)
_directGzipHead-4              0.74 ± 5%      0.75 ± 5%     ~     (p=0.548 n=5+5)
_noDirectGzip-4                4.31 ± 3%      4.23 ± 4%     ~     (p=0.548 n=5+5)
_directGzip_decode-4           11.3 ± 7%      11.3 ± 6%     ~     (p=0.841 n=5+5)
_noDirectGzip_decode-4         4.22 ± 2%      4.30 ± 3%     ~     (p=0.151 n=5+5)
_htmlResponse-4                1.27 ± 6%      1.25 ± 6%     ~     (p=0.421 n=5+5)
_jsonBodyManual-4              0.90 ± 3%      0.90 ± 6%     ~     (p=1.000 n=5+5)
_jsonBody-4                    1.30 ± 6%      1.25 ± 4%     ~     (p=0.151 n=5+5)
_jsonBodyValidation-4          1.60 ± 6%      1.60 ± 9%     ~     (p=0.897 n=5+5)
_outputHeaders-4               1.18 ± 3%      1.20 ± 8%     ~     (p=0.841 n=5+5)
_requestResponseMapping-4      1.37 ± 7%      1.36 ± 8%     ~     (p=0.841 n=5+5)
_validation-4                  1.49 ± 4%      1.44 ± 4%     ~     (p=0.310 n=5+5)
_noValidation-4                1.08 ± 8%      1.08 ± 6%     ~     (p=0.651 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 0.83 ±14%      0.82 ± 6%     ~     (p=0.841 n=5+5)
_ok-4                          0.80 ± 7%      0.82 ± 6%     ~     (p=0.548 n=5+5)
_invalidBody-4                 1.11 ± 7%      1.11 ±12%     ~     (p=0.841 n=5+5)

name                       old 90%:ms     new 90%:ms     delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-4                  1.47 ± 7%      1.46 ± 3%     ~     (p=0.952 n=5+5)
_directGzipHead-4              1.42 ± 4%      1.48 ± 3%     ~     (p=0.095 n=5+5)
_noDirectGzip-4                9.91 ± 3%      9.81 ± 4%     ~     (p=0.690 n=5+5)
_directGzip_decode-4           31.7 ± 5%      30.8 ± 2%     ~     (p=0.151 n=5+5)
_noDirectGzip_decode-4         10.0 ± 5%       9.8 ± 1%     ~     (p=0.310 n=5+5)
_jsonBody-4                    3.19 ± 5%      3.15 ± 6%     ~     (p=0.690 n=5+5)
_jsonBodyValidation-4          3.53 ± 3%      3.57 ± 4%     ~     (p=0.841 n=5+5)
_outputHeaders-4               1.48 ± 5%      1.48 ± 5%     ~     (p=0.841 n=5+5)
_requestResponseMapping-4      3.11 ± 3%      3.09 ± 3%     ~     (p=0.548 n=5+5)
_validation-4                  3.34 ± 3%      3.38 ± 4%     ~     (p=0.595 n=5+5)
_noValidation-4                2.37 ± 3%      2.42 ± 3%     ~     (p=0.310 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  1.51 ± 6%      1.51 ± 4%     ~     (p=1.000 n=5+5)
_directGzipHead-4              1.45 ± 3%      1.46 ± 7%     ~     (p=0.690 n=5+5)
_noDirectGzip-4                8.77 ± 6%      8.71 ± 4%     ~     (p=1.000 n=5+5)
_directGzip_decode-4           31.6 ± 5%      29.4 ± 5%   -7.17%  (p=0.016 n=5+5)
_noDirectGzip_decode-4         8.77 ± 4%      8.54 ± 2%     ~     (p=0.056 n=5+5)
_htmlResponse-4                2.73 ± 8%      2.67 ± 3%     ~     (p=0.421 n=5+5)
_jsonBodyManual-4              1.81 ± 4%      1.88 ± 6%     ~     (p=0.222 n=5+5)
_jsonBody-4                    2.83 ± 5%      2.88 ± 6%     ~     (p=0.516 n=5+5)
_jsonBodyValidation-4          3.64 ± 4%      3.63 ± 6%     ~     (p=0.690 n=5+5)
_outputHeaders-4               2.70 ± 2%      2.68 ± 2%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4      3.12 ± 3%      3.15 ± 6%     ~     (p=1.000 n=5+5)
_validation-4                  3.31 ± 3%      3.32 ± 6%     ~     (p=1.000 n=5+5)
_noValidation-4                2.31 ± 3%      2.36 ± 4%     ~     (p=0.135 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 1.66 ±13%      1.70 ±11%     ~     (p=0.548 n=5+5)
_ok-4                          1.64 ± 6%      1.71 ± 3%     ~     (p=0.222 n=5+5)
_invalidBody-4                 2.42 ± 4%      2.48 ± 4%     ~     (p=0.310 n=5+5)

name                       old 99%:ms     new 99%:ms     delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-4                  2.35 ± 4%      2.38 ± 5%     ~     (p=0.690 n=5+5)
_directGzipHead-4              2.44 ± 4%      2.46 ±14%     ~     (p=0.421 n=5+5)
_noDirectGzip-4                15.0 ± 4%      14.7 ± 4%     ~     (p=0.310 n=5+5)
_directGzip_decode-4           59.8 ± 5%      57.8 ±10%     ~     (p=0.310 n=5+5)
_noDirectGzip_decode-4         15.5 ±23%      15.1 ± 5%     ~     (p=0.548 n=5+5)
_jsonBody-4                    5.12 ± 6%      4.94 ± 6%     ~     (p=0.238 n=5+5)
_jsonBodyValidation-4          6.03 ± 9%      5.86 ± 4%     ~     (p=0.421 n=5+5)
_outputHeaders-4               2.56 ± 6%      2.65 ±10%     ~     (p=0.690 n=5+5)
_requestResponseMapping-4      5.46 ± 4%      5.55 ± 6%     ~     (p=0.841 n=5+5)
_validation-4                  5.82 ±10%      6.19 ± 9%     ~     (p=0.222 n=5+5)
_noValidation-4                4.24 ± 5%      4.33 ± 5%     ~     (p=0.421 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  2.36 ± 3%      2.48 ± 9%   +4.91%  (p=0.048 n=4+5)
_directGzipHead-4              2.54 ±10%      2.70 ±26%     ~     (p=0.548 n=5+5)
_noDirectGzip-4                13.4 ± 3%      13.2 ± 3%     ~     (p=0.421 n=5+5)
_directGzip_decode-4           60.3 ± 6%      56.5 ± 8%   -6.30%  (p=0.032 n=5+5)
_noDirectGzip_decode-4         12.9 ± 8%      13.0 ± 5%     ~     (p=0.730 n=5+5)
_htmlResponse-4                4.68 ± 5%      4.71 ± 6%     ~     (p=0.841 n=5+5)
_jsonBodyManual-4              3.19 ± 4%      3.13 ± 5%     ~     (p=0.548 n=5+5)
_jsonBody-4                    4.92 ±10%      5.03 ± 7%     ~     (p=0.841 n=5+5)
_jsonBodyValidation-4          6.44 ± 6%      6.56 ± 8%     ~     (p=0.841 n=5+5)
_outputHeaders-4               4.82 ±11%      4.61 ± 8%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4      5.32 ± 5%      5.01 ± 7%     ~     (p=0.056 n=5+5)
_validation-4                  5.50 ±21%      5.40 ±10%     ~     (p=0.794 n=5+5)
_noValidation-4                3.88 ± 4%      4.07 ± 9%     ~     (p=0.222 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 2.89 ±28%      2.90 ±30%     ~     (p=1.000 n=5+5)
_ok-4                          2.66 ± 4%      2.68 ± 9%     ~     (p=1.000 n=5+5)
_invalidBody-4                 4.67 ±22%      4.59 ±14%     ~     (p=0.841 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-4                  3.91 ±11%      3.92 ±41%     ~     (p=0.310 n=5+5)
_directGzipHead-4              3.97 ±16%      5.33 ±82%     ~     (p=0.548 n=5+5)
_noDirectGzip-4                19.4 ± 6%      18.8 ± 4%     ~     (p=0.103 n=5+5)
_directGzip_decode-4           80.4 ± 8%      79.7 ±21%     ~     (p=0.690 n=5+5)
_noDirectGzip_decode-4         18.6 ± 5%      18.9 ± 5%     ~     (p=0.556 n=4+5)
_jsonBody-4                    8.25 ±22%      7.44 ±11%     ~     (p=0.421 n=5+5)
_jsonBodyValidation-4          9.21 ±20%      9.28 ±11%     ~     (p=1.000 n=5+5)
_outputHeaders-4               5.62 ±24%      5.18 ± 9%     ~     (p=0.690 n=5+5)
_requestResponseMapping-4      9.07 ±12%      8.96 ± 3%     ~     (p=0.151 n=5+5)
_validation-4                  9.38 ±12%      9.90 ±13%     ~     (p=0.421 n=5+5)
_noValidation-4                7.58 ±12%      6.99 ±15%     ~     (p=0.421 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  4.86 ±80%      4.92 ±58%     ~     (p=0.421 n=5+5)
_directGzipHead-4              5.23 ± 8%      4.12 ± 9%  -21.09%  (p=0.016 n=5+4)
_noDirectGzip-4                18.3 ± 6%      17.2 ± 8%     ~     (p=0.056 n=5+5)
_directGzip_decode-4           84.8 ±13%      77.5 ±13%     ~     (p=0.151 n=5+5)
_noDirectGzip_decode-4         16.8 ± 9%      17.2 ±19%     ~     (p=1.000 n=5+5)
_htmlResponse-4                7.61 ±13%      8.49 ±26%     ~     (p=0.421 n=5+5)
_jsonBodyManual-4              6.48 ±19%      6.52 ±27%     ~     (p=1.000 n=5+5)
_jsonBody-4                    7.38 ±13%      8.22 ±20%     ~     (p=0.548 n=5+5)
_jsonBodyValidation-4          10.0 ± 7%       9.7 ± 7%     ~     (p=0.310 n=5+5)
_outputHeaders-4               8.02 ±24%      6.86 ± 8%     ~     (p=0.222 n=5+5)
_requestResponseMapping-4      8.59 ±10%      8.49 ±18%     ~     (p=1.000 n=5+5)
_validation-4                  8.54 ±20%      8.96 ±14%     ~     (p=0.841 n=5+5)
_noValidation-4                5.77 ±11%      6.41 ±15%     ~     (p=0.151 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 5.69 ±78%      5.57 ±81%     ~     (p=0.690 n=5+5)
_ok-4                          4.46 ±16%      4.56 ±45%     ~     (p=0.690 n=5+5)
_invalidBody-4                 7.88 ±83%      6.53 ±16%     ~     (p=1.000 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-4                   630 ± 0%       630 ± 0%     ~     (all equal)
_directGzipHead-4               174 ± 0%       174 ± 0%     ~     (all equal)
_noDirectGzip-4               1.03k ± 0%     1.03k ± 0%     ~     (all equal)
_directGzip_decode-4            630 ± 0%       630 ± 0%     ~     (all equal)
_noDirectGzip_decode-4        1.03k ± 0%     1.03k ± 0%     ~     (all equal)
_jsonBody-4                     199 ± 0%       199 ± 0%     ~     (all equal)
_jsonBodyValidation-4           185 ± 0%       185 ± 0%     ~     (all equal)
_outputHeaders-4                146 ± 0%       146 ± 0%     ~     (all equal)
_requestResponseMapping-4      94.0 ± 0%      94.0 ± 0%     ~     (all equal)
_validation-4                   168 ± 0%       168 ± 0%     ~     (all equal)
_noValidation-4                 168 ± 0%       168 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                   638 ± 0%       638 ± 0%     ~     (all equal)
_directGzipHead-4               182 ± 0%       182 ± 0%     ~     (all equal)
_noDirectGzip-4               1.04k ± 0%     1.04k ± 0%     ~     (all equal)
_directGzip_decode-4            638 ± 0%       638 ± 0%     ~     (all equal)
_noDirectGzip_decode-4        1.04k ± 0%     1.04k ± 0%     ~     (all equal)
_htmlResponse-4                 355 ± 0%       355 ± 0%     ~     (all equal)
_jsonBodyManual-4               207 ± 0%       207 ± 0%     ~     (all equal)
_jsonBody-4                     207 ± 0%       207 ± 0%     ~     (all equal)
_jsonBodyValidation-4           193 ± 0%       193 ± 0%     ~     (all equal)
_outputHeaders-4                214 ± 0%       214 ± 0%     ~     (all equal)
_requestResponseMapping-4       108 ± 0%       108 ± 0%     ~     (all equal)
_validation-4                   176 ± 0%       176 ± 0%     ~     (all equal)
_noValidation-4                 176 ± 0%       176 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                  322 ± 0%       322 ± 0%     ~     (all equal)
_ok-4                           344 ± 0%       344 ± 0%     ~     (all equal)
_invalidBody-4                  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-4                   103 ± 0%       103 ± 0%     ~     (all equal)
_directGzipHead-4               104 ± 0%       104 ± 0%     ~     (all equal)
_noDirectGzip-4                 117 ± 0%       117 ± 0%     ~     (all equal)
_directGzip_decode-4            116 ± 0%       116 ± 0%     ~     (all equal)
_noDirectGzip_decode-4          130 ± 0%       130 ± 0%     ~     (all equal)
_jsonBody-4                     188 ± 0%       188 ± 0%     ~     (all equal)
_jsonBodyValidation-4           192 ± 0%       192 ± 0%     ~     (all equal)
_outputHeaders-4               77.0 ± 0%      77.0 ± 0%     ~     (all equal)
_requestResponseMapping-4       169 ± 0%       169 ± 0%     ~     (all equal)
_validation-4                   170 ± 0%       170 ± 0%     ~     (all equal)
_noValidation-4                 173 ± 0%       173 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                   103 ± 0%       103 ± 0%     ~     (all equal)
_directGzipHead-4               104 ± 0%       104 ± 0%     ~     (all equal)
_noDirectGzip-4                 117 ± 0%       117 ± 0%     ~     (all equal)
_directGzip_decode-4            116 ± 0%       116 ± 0%     ~     (all equal)
_noDirectGzip_decode-4          130 ± 0%       130 ± 0%     ~     (all equal)
_htmlResponse-4                 108 ± 0%       108 ± 0%     ~     (all equal)
_jsonBodyManual-4               195 ± 0%       195 ± 0%     ~     (all equal)
_jsonBody-4                     188 ± 0%       188 ± 0%     ~     (all equal)
_jsonBodyValidation-4           192 ± 0%       192 ± 0%     ~     (all equal)
_outputHeaders-4               88.0 ± 0%      88.0 ± 0%     ~     (all equal)
_requestResponseMapping-4       169 ± 0%       169 ± 0%     ~     (all equal)
_validation-4                   170 ± 0%       170 ± 0%     ~     (all equal)
_noValidation-4                 173 ± 0%       173 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 74.0 ± 0%      74.0 ± 0%     ~     (all equal)
_ok-4                          74.0 ± 0%      74.0 ± 0%     ~     (all equal)
_invalidBody-4                  137 ± 0%       137 ± 0%     ~     (all equal)

name                       old rps        new rps        delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-4                 62.1k ± 1%     61.6k ± 2%     ~     (p=0.421 n=5+5)
_directGzipHead-4             62.6k ± 1%     61.1k ± 8%     ~     (p=0.222 n=5+5)
_noDirectGzip-4               9.73k ± 1%     9.76k ± 1%     ~     (p=0.690 n=5+5)
_directGzip_decode-4          2.98k ± 1%     2.97k ± 0%     ~     (p=0.841 n=5+5)
_noDirectGzip_decode-4        9.60k ± 4%     9.72k ± 1%     ~     (p=0.381 n=5+5)
_jsonBody-4                   29.2k ± 2%     29.3k ± 1%     ~     (p=0.690 n=5+5)
_jsonBodyValidation-4         25.8k ± 1%     25.7k ± 1%     ~     (p=0.841 n=5+5)
_outputHeaders-4              59.9k ± 1%     60.1k ± 1%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4     30.1k ± 2%     29.8k ± 0%     ~     (p=0.151 n=5+5)
_validation-4                 28.1k ± 1%     27.6k ± 1%     ~     (p=0.056 n=5+5)
_noValidation-4               39.2k ± 2%     39.1k ± 1%     ~     (p=0.690 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                 60.6k ± 0%     60.3k ± 4%     ~     (p=0.905 n=4+5)
_directGzipHead-4             60.7k ± 2%     60.3k ± 8%     ~     (p=0.310 n=5+5)
_noDirectGzip-4               10.9k ± 1%     10.9k ± 1%     ~     (p=0.841 n=5+5)
_directGzip_decode-4          3.10k ± 1%     3.10k ± 1%     ~     (p=0.651 n=5+5)
_noDirectGzip_decode-4        10.8k ± 1%     10.8k ± 1%     ~     (p=1.000 n=5+5)
_htmlResponse-4               34.3k ± 0%     34.2k ± 1%     ~     (p=0.548 n=5+5)
_jsonBodyManual-4             48.3k ± 1%     48.8k ± 1%     ~     (p=0.056 n=5+5)
_jsonBody-4                   32.8k ± 1%     32.7k ± 1%     ~     (p=0.548 n=5+5)
_jsonBodyValidation-4         25.6k ± 2%     25.5k ± 1%     ~     (p=0.690 n=5+5)
_outputHeaders-4              35.2k ± 1%     35.3k ± 0%     ~     (p=1.000 n=5+5)
_requestResponseMapping-4     29.9k ± 3%     30.2k ± 2%     ~     (p=0.421 n=5+5)
_validation-4                 28.2k ± 1%     28.1k ± 1%     ~     (p=0.286 n=4+5)
_noValidation-4               39.4k ± 1%     39.2k ± 1%     ~     (p=0.310 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                55.1k ± 0%     53.3k ± 8%   -3.33%  (p=0.016 n=4+5)
_ok-4                         54.9k ± 0%     54.7k ± 1%     ~     (p=0.690 n=5+5)
_invalidBody-4                37.7k ± 3%     37.7k ± 3%     ~     (p=0.690 n=5+5)

name                       old alloc/op   new alloc/op   delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-4                3.85kB ± 0%    3.85kB ± 0%     ~     (p=0.651 n=5+5)
_directGzipHead-4            3.85kB ± 0%    3.85kB ± 0%     ~     (p=0.968 n=4+5)
_noDirectGzip-4              6.40kB ±18%    6.53kB ±20%     ~     (p=0.841 n=5+5)
_directGzip_decode-4          404kB ± 0%     404kB ± 0%     ~     (p=0.095 n=5+5)
_noDirectGzip_decode-4       5.48kB ± 9%    5.82kB ± 9%     ~     (p=0.151 n=5+5)
_jsonBody-4                  13.2kB ± 0%    13.2kB ± 0%     ~     (p=0.595 n=5+5)
_jsonBodyValidation-4        19.0kB ± 0%    19.0kB ± 0%     ~     (p=0.794 n=5+5)
_outputHeaders-4             3.57kB ± 0%    3.57kB ± 0%     ~     (p=0.556 n=5+5)
_requestResponseMapping-4    16.7kB ± 0%    16.7kB ± 0%     ~     (p=0.548 n=5+5)
_validation-4                16.6kB ± 0%    16.6kB ± 0%     ~     (p=0.238 n=5+5)
_noValidation-4              7.78kB ± 0%    7.78kB ± 0%     ~     (p=0.833 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                3.89kB ± 0%    3.89kB ± 0%     ~     (p=0.881 n=5+5)
_directGzipHead-4            3.88kB ± 0%    3.88kB ± 0%     ~     (p=0.960 n=5+5)
_noDirectGzip-4              7.11kB ±32%    6.67kB ±19%     ~     (p=0.548 n=5+5)
_directGzip_decode-4          404kB ± 0%     404kB ± 0%     ~     (p=0.151 n=5+5)
_noDirectGzip_decode-4       6.23kB ±15%    6.08kB ±18%     ~     (p=0.841 n=5+5)
_htmlResponse-4              8.08kB ± 0%    8.08kB ± 0%     ~     (p=0.135 n=5+5)
_jsonBodyManual-4            4.50kB ± 0%    4.50kB ± 0%     ~     (p=0.730 n=5+5)
_jsonBody-4                  10.3kB ± 0%    10.3kB ± 0%     ~     (p=0.762 n=5+5)
_jsonBodyValidation-4        19.1kB ± 0%    19.1kB ± 0%     ~     (p=0.889 n=5+5)
_outputHeaders-4             10.4kB ± 0%    10.4kB ± 0%     ~     (p=0.889 n=5+5)
_requestResponseMapping-4    16.7kB ± 0%    16.7kB ± 0%     ~     (p=0.690 n=5+5)
_validation-4                16.6kB ± 0%    16.6kB ± 0%     ~     (p=0.730 n=5+5)
_noValidation-4              7.83kB ± 0%    7.84kB ± 0%     ~     (p=0.111 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4               4.65kB ± 0%    4.65kB ± 0%     ~     (p=0.556 n=5+5)
_ok-4                        4.56kB ± 0%    4.56kB ± 0%     ~     (p=0.371 n=4+4)
_invalidBody-4               8.27kB ± 0%    8.27kB ± 0%     ~     (p=0.629 n=4+4)

name                       old allocs/op  new allocs/op  delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-4                  42.0 ± 0%      42.0 ± 0%     ~     (all equal)
_directGzipHead-4              42.0 ± 0%      42.0 ± 0%     ~     (all equal)
_noDirectGzip-4                49.2 ± 4%      49.2 ± 4%     ~     (p=1.000 n=5+5)
_directGzip_decode-4            503 ± 0%       503 ± 0%     ~     (p=0.556 n=5+4)
_noDirectGzip_decode-4         50.0 ± 0%      50.0 ± 0%     ~     (all equal)
_jsonBody-4                     128 ± 0%       128 ± 0%     ~     (all equal)
_jsonBodyValidation-4           186 ± 0%       186 ± 0%     ~     (all equal)
_outputHeaders-4               36.0 ± 0%      36.0 ± 0%     ~     (all equal)
_requestResponseMapping-4       124 ± 0%       124 ± 0%     ~     (all equal)
_validation-4                   154 ± 0%       155 ± 0%     ~     (p=0.238 n=4+5)
_noValidation-4                91.0 ± 0%      91.0 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  44.0 ± 0%      44.0 ± 0%     ~     (all equal)
_directGzipHead-4              44.0 ± 0%      44.0 ± 0%     ~     (all equal)
_noDirectGzip-4                51.2 ± 4%      51.2 ± 4%     ~     (p=1.000 n=5+5)
_directGzip_decode-4            505 ± 0%       505 ± 0%     ~     (all equal)
_noDirectGzip_decode-4         52.0 ± 0%      52.0 ± 0%     ~     (all equal)
_htmlResponse-4                 145 ± 0%       145 ± 0%     ~     (all equal)
_jsonBodyManual-4              49.0 ± 0%      49.0 ± 0%     ~     (all equal)
_jsonBody-4                     100 ± 0%       100 ± 0%     ~     (all equal)
_jsonBodyValidation-4           188 ± 0%       188 ± 0%     ~     (all equal)
_outputHeaders-4                113 ± 0%       113 ± 0%     ~     (all equal)
_requestResponseMapping-4       126 ± 0%       126 ± 0%     ~     (all equal)
_validation-4                   156 ± 0%       156 ± 0%     ~     (all equal)
_noValidation-4                93.0 ± 0%      93.0 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 53.0 ± 0%      53.0 ± 0%     ~     (all equal)
_ok-4                          49.0 ± 0%      49.0 ± 0%     ~     (all equal)
_invalidBody-4                 97.0 ± 0%      97.0 ± 0%     ~     (all equal)

@vearutop vearutop merged commit d64d866 into master Dec 7, 2023
9 of 11 checks passed
@vearutop vearutop deleted the desc-status branch December 7, 2023 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant