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

Avoid http writer panic on broken pipe #200

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Avoid http writer panic on broken pipe #200

merged 1 commit into from
Mar 29, 2024

Conversation

vearutop
Copy link
Member

@vearutop vearutop commented Mar 29, 2024

Fixes #198.

Copy link

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 113 8736 (+2) 6299 (+2) 660 1777 1040 (+1) 213.5K (+55B)

Copy link

Go API Changes

# summary
Inferred base version: v0.2.65
Suggested version: v0.2.66

Copy link

Unit Test Coverage

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

Coverage of changed lines
File Function Coverage
Total 66.7%
response/gzip/middleware.go 66.7%
response/gzip/middleware.go:29 Middleware 100.0%
Coverage diff with base branch

No changes in coverage.

Copy link

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.05µs ± 3%    1.03µs ± 1%    ~     (p=0.195 n=6+6)
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                           464ns ± 0%     459ns ± 1%    ~     (p=0.056 n=5+5)
DecoderFunc_Decode-4                      1.38µs ± 1%    1.38µs ± 2%    ~     (p=0.459 n=6+6)
Decoder_Decode_json-4                     17.6µs ± 2%    17.4µs ± 0%  -1.22%  (p=0.009 n=6+5)
Decoder_Decode_queryObject-4              3.75µs ± 0%    3.68µs ± 0%  -1.94%  (p=0.002 n=6+6)
Decoder_Decode_jsonParam-4                1.44µs ± 1%    1.42µs ± 1%  -1.17%  (p=0.009 n=6+6)
DecoderFactory_SetDecoderFunc-4           1.22µs ± 1%    1.21µs ± 1%  -1.35%  (p=0.009 n=6+6)
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                              7.91µs ± 1%    7.85µs ± 1%    ~     (p=0.082 n=6+5)
Middleware_control-4                      2.56µs ± 2%    2.57µs ± 1%    ~     (p=0.699 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.3kB ± 0%    12.3kB ± 0%    ~     (all equal)
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.26kB ± 3%    1.28kB ± 4%    ~     (p=0.818 n=6+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                  12.0 ± 0%      12.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.03µs ± 1%
pkg:github.com/swaggest/rest/request goos:linux goarch:amd64
Decoder_Decode-4                         459ns ± 1%
DecoderFunc_Decode-4                    1.38µs ± 2%
Decoder_Decode_json-4                   17.4µs ± 0%
Decoder_Decode_queryObject-4            3.68µs ± 0%
Decoder_Decode_jsonParam-4              1.42µs ± 1%
DecoderFactory_SetDecoderFunc-4         1.21µs ± 1%
pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64
Middleware-4                            7.85µs ± 1%
Middleware_control-4                    2.57µs ± 1%

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.3kB ± 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.28kB ± 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                12.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

codecov bot commented Mar 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.10%. Comparing base (45ef3c6) to head (ecdb142).
Report is 1 commits behind head on master.

Files Patch % Lines
response/gzip/middleware.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #200   +/-   ##
=======================================
  Coverage   76.10%   76.10%           
=======================================
  Files          30       30           
  Lines        1724     1724           
=======================================
  Hits         1312     1312           
  Misses        297      297           
  Partials      115      115           
Flag Coverage Δ
unittests 76.10% <0.00%> (ø)

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.

@vearutop vearutop merged commit a54f132 into master Mar 29, 2024
10 of 11 checks passed
@vearutop vearutop deleted the epipe-panic branch March 29, 2024 21:06
Copy link

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                17.1µs ± 6%    16.4µs ± 1%     ~     (p=0.222 n=5+5)
_directGzipHead-4            16.4µs ± 1%    16.3µs ± 1%     ~     (p=0.413 n=5+4)
_noDirectGzip-4              91.8µs ± 1%    92.4µs ± 1%     ~     (p=0.056 n=5+5)
_directGzip_decode-4          327µs ± 1%     328µs ± 1%     ~     (p=0.690 n=5+5)
_noDirectGzip_decode-4       92.1µs ± 0%    92.3µs ± 1%     ~     (p=1.000 n=5+5)
_jsonBody-4                  35.2µs ± 2%    35.2µs ± 1%     ~     (p=1.000 n=5+5)
_jsonBodyValidation-4        40.2µs ± 1%    40.8µs ± 1%     ~     (p=0.222 n=5+5)
_outputHeaders-4             16.9µs ± 1%    16.9µs ± 0%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4    34.8µs ± 1%    35.0µs ± 2%     ~     (p=0.690 n=5+5)
_validation-4                37.4µs ± 1%    37.4µs ± 1%     ~     (p=1.000 n=5+5)
_noValidation-4              26.3µs ± 1%    26.2µs ± 3%     ~     (p=0.151 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                16.6µs ± 0%    16.6µs ± 1%     ~     (p=0.730 n=5+4)
_directGzipHead-4            16.6µs ± 1%    16.5µs ± 1%     ~     (p=0.730 n=4+5)
_noDirectGzip-4              93.2µs ± 1%    92.5µs ± 1%     ~     (p=0.095 n=5+5)
_directGzip_decode-4          337µs ± 6%     330µs ± 2%     ~     (p=0.310 n=5+5)
_noDirectGzip_decode-4       93.3µs ± 1%    92.6µs ± 1%     ~     (p=0.095 n=5+5)
_htmlResponse-4              29.9µs ± 1%    30.0µs ± 1%     ~     (p=0.222 n=5+5)
_jsonBodyManual-4            20.8µs ± 1%    21.0µs ± 2%     ~     (p=0.056 n=5+5)
_jsonBody-4                  31.3µs ± 1%    31.3µs ± 1%     ~     (p=0.841 n=5+5)
_jsonBodyValidation-4        40.7µs ± 1%    41.3µs ± 4%     ~     (p=0.310 n=5+5)
_outputHeaders-4             29.9µs ± 4%    29.2µs ± 1%     ~     (p=0.095 n=5+5)
_requestResponseMapping-4    34.5µs ± 1%    34.5µs ± 1%     ~     (p=0.548 n=5+5)
_validation-4                36.8µs ± 2%    36.9µs ± 2%     ~     (p=0.548 n=5+5)
_noValidation-4              26.0µs ± 1%    26.2µs ± 1%   +0.88%  (p=0.048 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4               18.4µs ± 1%    18.7µs ± 1%     ~     (p=0.057 n=4+4)
_ok-4                        18.5µs ± 1%    18.5µs ± 0%     ~     (p=1.000 n=5+4)
_invalidBody-4               26.8µs ± 4%    27.6µs ± 5%     ~     (p=0.222 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.74 ± 3%      0.72 ±10%     ~     (p=0.151 n=5+5)
_directGzipHead-4              0.71 ± 4%      0.71 ±16%     ~     (p=0.222 n=5+5)
_noDirectGzip-4                4.40 ± 2%      4.26 ± 6%     ~     (p=0.310 n=5+5)
_directGzip_decode-4           10.9 ± 6%      10.7 ± 6%     ~     (p=0.690 n=5+5)
_noDirectGzip_decode-4         4.17 ± 2%      4.25 ± 5%     ~     (p=0.151 n=5+5)
_jsonBody-4                    1.47 ± 7%      1.44 ± 5%     ~     (p=0.794 n=5+5)
_jsonBodyValidation-4          1.64 ± 4%      1.75 ± 7%     ~     (p=0.095 n=5+5)
_outputHeaders-4               0.72 ± 2%      0.75 ± 6%     ~     (p=0.095 n=5+5)
_requestResponseMapping-4      1.40 ± 8%      1.45 ± 4%     ~     (p=0.222 n=5+5)
_validation-4                  1.58 ± 4%      1.52 ± 5%     ~     (p=0.151 n=5+5)
_noValidation-4                1.12 ± 4%      1.07 ± 3%     ~     (p=0.056 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  0.74 ± 2%      0.73 ±10%     ~     (p=0.548 n=5+5)
_directGzipHead-4              0.74 ± 7%      0.73 ± 8%     ~     (p=0.421 n=5+5)
_noDirectGzip-4                4.24 ± 4%      4.17 ± 4%     ~     (p=0.690 n=5+5)
_directGzip_decode-4           11.2 ± 8%      10.7 ±10%     ~     (p=0.421 n=5+5)
_noDirectGzip_decode-4         4.25 ± 5%      4.17 ± 6%     ~     (p=0.310 n=5+5)
_htmlResponse-4                1.27 ± 2%      1.29 ± 5%     ~     (p=0.254 n=5+5)
_jsonBodyManual-4              0.93 ± 7%      0.92 ± 9%     ~     (p=0.841 n=5+5)
_jsonBody-4                    1.32 ± 5%      1.30 ± 5%     ~     (p=0.548 n=5+5)
_jsonBodyValidation-4          1.67 ± 5%      1.72 ± 4%     ~     (p=0.310 n=5+5)
_outputHeaders-4               1.19 ± 7%      1.24 ± 8%     ~     (p=0.222 n=5+5)
_requestResponseMapping-4      1.39 ± 4%      1.38 ± 4%     ~     (p=0.690 n=5+5)
_validation-4                  1.49 ± 3%      1.50 ± 6%     ~     (p=1.000 n=5+5)
_noValidation-4                1.09 ± 8%      1.13 ± 6%     ~     (p=0.310 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 0.82 ± 5%      0.89 ±10%     ~     (p=0.095 n=5+5)
_ok-4                          0.81 ± 5%      0.82 ± 7%     ~     (p=0.690 n=5+5)
_invalidBody-4                 1.11 ±10%      1.14 ±10%     ~     (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-4                  1.54 ± 8%      1.50 ± 6%     ~     (p=0.246 n=5+5)
_directGzipHead-4              1.53 ± 7%      1.46 ± 5%     ~     (p=0.222 n=5+5)
_noDirectGzip-4                8.50 ± 1%      8.52 ± 4%     ~     (p=0.952 n=5+5)
_directGzip_decode-4           31.9 ± 5%      31.0 ± 4%     ~     (p=0.310 n=5+5)
_noDirectGzip_decode-4         8.67 ± 2%      8.61 ± 3%     ~     (p=0.937 n=5+5)
_jsonBody-4                    3.30 ± 6%      3.20 ± 3%     ~     (p=0.310 n=5+5)
_jsonBodyValidation-4          3.77 ± 5%      3.64 ± 4%     ~     (p=0.421 n=5+5)
_outputHeaders-4               1.50 ± 4%      1.54 ± 4%     ~     (p=0.310 n=5+5)
_requestResponseMapping-4      3.21 ± 4%      3.30 ± 5%     ~     (p=0.421 n=5+5)
_validation-4                  3.45 ± 3%      3.43 ± 2%     ~     (p=0.841 n=5+5)
_noValidation-4                2.46 ± 5%      2.46 ± 3%     ~     (p=1.000 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  1.51 ± 3%      1.56 ± 8%     ~     (p=0.206 n=5+5)
_directGzipHead-4              1.51 ± 9%      1.51 ± 2%     ~     (p=0.421 n=5+5)
_noDirectGzip-4                8.72 ± 3%      8.86 ± 2%     ~     (p=0.222 n=5+5)
_directGzip_decode-4           33.5 ±13%      32.3 ± 8%     ~     (p=1.000 n=5+5)
_noDirectGzip_decode-4         8.83 ± 4%      8.69 ± 4%     ~     (p=0.421 n=5+5)
_htmlResponse-4                2.70 ± 4%      2.70 ± 2%     ~     (p=1.000 n=5+5)
_jsonBodyManual-4              1.84 ± 0%      1.87 ± 3%     ~     (p=0.190 n=4+5)
_jsonBody-4                    2.93 ± 4%      2.92 ± 4%     ~     (p=0.595 n=5+5)
_jsonBodyValidation-4          3.76 ± 2%      3.75 ± 5%     ~     (p=0.690 n=5+5)
_outputHeaders-4               2.82 ± 5%      2.74 ± 4%     ~     (p=0.151 n=5+5)
_requestResponseMapping-4      3.29 ± 4%      3.21 ± 6%     ~     (p=0.310 n=5+5)
_validation-4                  3.41 ± 8%      3.34 ± 1%     ~     (p=1.000 n=5+5)
_noValidation-4                2.39 ± 1%      2.47 ± 4%     ~     (p=0.095 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 1.69 ±10%      1.73 ± 6%     ~     (p=0.421 n=5+5)
_ok-4                          1.71 ± 7%      1.75 ±13%     ~     (p=0.841 n=5+5)
_invalidBody-4                 2.55 ± 7%      2.62 ± 7%     ~     (p=0.421 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.79 ±15%      2.44 ± 5%     ~     (p=0.222 n=5+5)
_directGzipHead-4              2.57 ± 5%      2.44 ± 3%     ~     (p=0.063 n=5+4)
_noDirectGzip-4                13.2 ± 3%      13.4 ± 2%     ~     (p=0.421 n=5+5)
_directGzip_decode-4           59.4 ± 2%      60.0 ±14%     ~     (p=0.889 n=5+5)
_noDirectGzip_decode-4         13.0 ± 3%      13.5 ± 7%     ~     (p=0.056 n=5+5)
_jsonBody-4                    5.50 ± 7%      5.39 ± 9%     ~     (p=0.690 n=5+5)
_jsonBodyValidation-4          6.34 ± 5%      6.39 ± 7%     ~     (p=0.690 n=5+5)
_outputHeaders-4               2.58 ± 7%      2.61 ± 3%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4      5.69 ± 6%      5.74 ± 7%     ~     (p=1.000 n=5+5)
_validation-4                  6.21 ± 7%      6.41 ±12%     ~     (p=0.548 n=5+5)
_noValidation-4                4.30 ± 5%      4.38 ± 8%     ~     (p=0.690 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  2.41 ± 4%      2.52 ± 2%     ~     (p=0.111 n=5+4)
_directGzipHead-4              2.84 ±30%      2.54 ± 4%     ~     (p=0.286 n=5+5)
_noDirectGzip-4                13.6 ± 5%      13.5 ± 6%     ~     (p=0.841 n=5+5)
_directGzip_decode-4           65.3 ±14%      59.1 ±11%     ~     (p=0.151 n=5+5)
_noDirectGzip_decode-4         13.4 ± 4%      13.4 ± 6%     ~     (p=0.548 n=5+5)
_htmlResponse-4                4.74 ± 4%      4.71 ±10%     ~     (p=0.690 n=5+5)
_jsonBodyManual-4              3.10 ± 5%      3.12 ±10%     ~     (p=0.690 n=5+5)
_jsonBody-4                    5.00 ± 5%      4.99 ± 7%     ~     (p=1.000 n=5+5)
_jsonBodyValidation-4          6.13 ± 6%      6.55 ±19%     ~     (p=0.421 n=5+5)
_outputHeaders-4               4.92 ±13%      4.55 ± 4%     ~     (p=0.095 n=5+5)
_requestResponseMapping-4      5.41 ± 9%      5.11 ± 3%     ~     (p=0.151 n=5+5)
_validation-4                  5.61 ± 3%      5.43 ± 7%     ~     (p=0.310 n=5+5)
_noValidation-4                4.00 ± 6%      4.17 ± 5%     ~     (p=0.095 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 2.84 ±25%      2.64 ± 3%     ~     (p=0.286 n=5+4)
_ok-4                          2.73 ± 6%      2.81 ±16%     ~     (p=0.690 n=5+5)
_invalidBody-4                 4.56 ± 6%      4.86 ± 6%     ~     (p=0.056 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                  6.30 ±64%      4.06 ±23%  -35.55%  (p=0.032 n=5+5)
_directGzipHead-4              5.07 ±10%      5.23 ±34%     ~     (p=0.841 n=5+5)
_noDirectGzip-4                17.2 ± 8%      18.6 ± 9%     ~     (p=0.151 n=5+5)
_directGzip_decode-4           81.7 ±12%      81.0 ±15%     ~     (p=0.841 n=5+5)
_noDirectGzip_decode-4         16.8 ± 3%      17.9 ±11%     ~     (p=0.222 n=5+5)
_jsonBody-4                    9.52 ±13%      9.05 ±14%     ~     (p=0.421 n=5+5)
_jsonBodyValidation-4          10.1 ± 7%       9.7 ±14%     ~     (p=0.548 n=5+5)
_outputHeaders-4               5.40 ±12%      5.29 ±18%     ~     (p=0.841 n=5+5)
_requestResponseMapping-4      9.27 ± 5%      8.91 ±10%     ~     (p=0.690 n=5+5)
_validation-4                  9.88 ±11%      9.52 ±11%     ~     (p=0.548 n=5+5)
_noValidation-4                7.33 ± 9%      7.32 ±15%     ~     (p=0.730 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                  3.96 ±14%      4.06 ±11%     ~     (p=0.730 n=5+4)
_directGzipHead-4              5.39 ± 3%      5.44 ± 7%     ~     (p=1.000 n=4+5)
_noDirectGzip-4                18.4 ±13%      19.9 ±22%     ~     (p=0.421 n=5+5)
_directGzip_decode-4           89.5 ±14%      84.0 ±15%     ~     (p=0.548 n=5+5)
_noDirectGzip_decode-4         19.4 ±17%      17.7 ±19%     ~     (p=0.421 n=5+5)
_htmlResponse-4                7.61 ± 8%      7.96 ±25%     ~     (p=0.690 n=5+5)
_jsonBodyManual-4              5.49 ± 9%      5.50 ±18%     ~     (p=0.690 n=5+5)
_jsonBody-4                    8.35 ±19%      8.15 ±20%     ~     (p=0.841 n=5+5)
_jsonBodyValidation-4          9.88 ±12%     10.73 ±25%     ~     (p=0.548 n=5+5)
_outputHeaders-4               8.10 ±29%      7.23 ± 8%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4      8.61 ± 5%      8.43 ± 5%     ~     (p=0.421 n=5+5)
_validation-4                  8.88 ±11%      8.72 ±13%     ~     (p=1.000 n=5+5)
_noValidation-4                6.38 ±17%      6.41 ±13%     ~     (p=1.000 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                 4.37 ± 9%      5.32 ±85%     ~     (p=1.000 n=4+5)
_ok-4                          4.99 ±17%      5.45 ±50%     ~     (p=0.952 n=5+5)
_invalidBody-4                 6.76 ±11%      8.07 ±16%     ~     (p=0.056 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                 58.5k ± 6%     60.9k ± 1%     ~     (p=0.222 n=5+5)
_directGzipHead-4             61.0k ± 1%     61.4k ± 1%     ~     (p=0.413 n=5+4)
_noDirectGzip-4               10.9k ± 1%     10.8k ± 1%     ~     (p=0.056 n=5+5)
_directGzip_decode-4          3.06k ± 1%     3.05k ± 1%     ~     (p=0.746 n=5+5)
_noDirectGzip_decode-4        10.9k ± 0%     10.8k ± 1%     ~     (p=1.000 n=5+5)
_jsonBody-4                   28.4k ± 2%     28.4k ± 1%     ~     (p=1.000 n=5+5)
_jsonBodyValidation-4         24.8k ± 1%     24.5k ± 1%     ~     (p=0.222 n=5+5)
_outputHeaders-4              59.1k ± 1%     59.2k ± 0%     ~     (p=0.421 n=5+5)
_requestResponseMapping-4     28.8k ± 1%     28.6k ± 2%     ~     (p=0.690 n=5+5)
_validation-4                 26.7k ± 1%     26.7k ± 1%     ~     (p=1.000 n=5+5)
_noValidation-4               38.0k ± 1%     38.2k ± 3%     ~     (p=0.151 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                 60.3k ± 0%     60.3k ± 1%     ~     (p=0.730 n=5+4)
_directGzipHead-4             60.3k ± 1%     60.5k ± 1%     ~     (p=0.730 n=4+5)
_noDirectGzip-4               10.7k ± 1%     10.8k ± 1%     ~     (p=0.095 n=5+5)
_directGzip_decode-4          2.97k ± 6%     3.03k ± 2%     ~     (p=0.310 n=5+5)
_noDirectGzip_decode-4        10.7k ± 1%     10.8k ± 1%     ~     (p=0.095 n=5+5)
_htmlResponse-4               33.5k ± 1%     33.3k ± 1%     ~     (p=0.222 n=5+5)
_jsonBodyManual-4             48.2k ± 1%     47.7k ± 2%     ~     (p=0.056 n=5+5)
_jsonBody-4                   31.9k ± 1%     31.9k ± 1%     ~     (p=1.000 n=5+5)
_jsonBodyValidation-4         24.6k ± 1%     24.2k ± 4%     ~     (p=0.310 n=5+5)
_outputHeaders-4              33.4k ± 4%     34.2k ± 1%     ~     (p=0.095 n=5+5)
_requestResponseMapping-4     29.0k ± 1%     29.0k ± 1%     ~     (p=0.548 n=5+5)
_validation-4                 27.2k ± 2%     27.1k ± 2%     ~     (p=0.548 n=5+5)
_noValidation-4               38.5k ± 1%     38.2k ± 1%     ~     (p=0.056 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-4                54.3k ± 1%     52.3k ± 9%   -3.70%  (p=0.032 n=4+5)
_ok-4                         53.9k ± 1%     54.0k ± 0%     ~     (p=1.000 n=5+4)
_invalidBody-4                37.3k ± 4%     36.3k ± 5%     ~     (p=0.222 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.86kB ± 0%    3.86kB ± 0%     ~     (p=0.611 n=5+5)
_directGzipHead-4            3.86kB ± 0%    3.86kB ± 0%     ~     (p=0.762 n=5+5)
_noDirectGzip-4              6.65kB ±27%    6.87kB ±17%     ~     (p=0.421 n=5+5)
_directGzip_decode-4          404kB ± 0%     404kB ± 0%     ~     (p=0.222 n=5+5)
_noDirectGzip_decode-4       5.75kB ± 4%    6.15kB ± 9%     ~     (p=0.151 n=5+5)
_jsonBody-4                  13.2kB ± 0%    13.2kB ± 0%     ~     (p=0.317 n=5+5)
_jsonBodyValidation-4        19.0kB ± 0%    19.1kB ± 0%     ~     (p=0.921 n=4+5)
_outputHeaders-4             3.58kB ± 0%    3.57kB ± 0%     ~     (p=0.333 n=5+5)
_requestResponseMapping-4    16.7kB ± 0%    16.7kB ± 0%     ~     (p=0.516 n=5+5)
_validation-4                16.6kB ± 0%    16.6kB ± 0%     ~     (p=0.595 n=5+5)
_noValidation-4              7.79kB ± 0%    7.79kB ± 0%     ~     (p=0.421 n=5+5)
pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64
_directGzip-4                3.87kB ± 0%    3.87kB ± 0%     ~     (p=0.825 n=5+5)
_directGzipHead-4            3.87kB ± 0%    3.87kB ± 0%     ~     (p=0.524 n=5+5)
_noDirectGzip-4              7.03kB ±22%    6.98kB ±16%     ~     (p=1.000 n=5+5)
_directGzip_decode-4          404kB ± 0%     404kB ± 0%     ~     (p=0.421 n=5+5)
_noDirectGzip_decode-4       6.54kB ± 8%    6.29kB ± 4%     ~     (p=0.222 n=5+5)
_htmlResponse-4              8.07kB ± 0%    8.07kB ± 0%     ~     (p=0.865 n=5+5)
_jsonBodyManual-4            4.48kB ± 0%    4.49kB ± 0%     ~     (p=0.175 n=4+5)
_jsonBody-4                  10.2kB ± 0%    10.2kB ± 0%     ~     (p=0.810 n=5+5)
_jsonBodyValidation-4        19.1kB ± 0%    19.1kB ± 0%     ~     (p=1.000 n=5+5)
_outputHeaders-4             10.4kB ± 0%    10.4kB ± 0%     ~     (p=0.111 n=5+5)
_requestResponseMapping-4    16.7kB ± 0%    16.7kB ± 0%     ~     (p=0.730 n=5+5)
_validation-4                16.6kB ± 0%    16.6kB ± 0%     ~     (p=0.151 n=5+5)
_noValidation-4              7.83kB ± 0%    7.83kB ± 0%     ~     (p=0.730 n=4+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.825 n=5+5)
_ok-4                        4.56kB ± 0%    4.56kB ± 0%     ~     (p=0.514 n=4+4)
_invalidBody-4               8.28kB ± 0%    8.28kB ± 0%     ~     (p=0.743 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            504 ± 0%       504 ± 0%     ~     (p=0.643 n=5+5)
_noDirectGzip_decode-4         50.0 ± 0%      50.0 ± 0%     ~     (all equal)
_jsonBody-4                     129 ± 0%       128 ± 0%     ~     (p=0.167 n=5+5)
_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                   155 ± 0%       155 ± 0%     ~     (all equal)
_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                  43.0 ± 0%      43.0 ± 0%     ~     (all equal)
_directGzipHead-4              43.0 ± 0%      43.0 ± 0%     ~     (all equal)
_noDirectGzip-4                50.2 ± 4%      50.2 ± 4%     ~     (p=1.000 n=5+5)
_directGzip_decode-4            504 ± 0%       504 ± 0%     ~     (p=1.000 n=5+5)
_noDirectGzip_decode-4         51.0 ± 0%      51.0 ± 0%     ~     (all equal)
_htmlResponse-4                 144 ± 0%       144 ± 0%     ~     (all equal)
_jsonBodyManual-4              48.0 ± 0%      48.0 ± 0%     ~     (all equal)
_jsonBody-4                    99.0 ± 0%      99.0 ± 0%     ~     (all equal)
_jsonBodyValidation-4           187 ± 0%       187 ± 0%     ~     (all equal)
_outputHeaders-4                112 ± 0%       112 ± 0%     ~     (all equal)
_requestResponseMapping-4       125 ± 0%       125 ± 0%     ~     (all equal)
_validation-4                   155 ± 0%       155 ± 0%     ~     (p=0.444 n=5+5)
_noValidation-4                92.0 ± 0%      92.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)

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.

Broken pipe should not cause panic in gzip writer
1 participant