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

Upgrade go-chi dependency to use modules #21

Closed vearutop closed 3 years ago

github-actions[bot] commented 3 years ago

Unit Test Coverage

total: (statements) 81.1%

Coverage diff with base branch ```diff ```
codecov[bot] commented 3 years ago

Codecov Report

Merging #21 (4a158d7) into master (5fcf449) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #21   +/-   ##
=======================================
  Coverage   73.29%   73.29%           
=======================================
  Files          26       26           
  Lines        1483     1483           
=======================================
  Hits         1087     1087           
  Misses        250      250           
  Partials      146      146           
Flag Coverage Δ
unittests 73.29% <ø> (ø)

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


Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5fcf449...4a158d7. Read the comment docs.

github-actions[bot] commented 3 years ago

Benchmark Result

Benchmark diff with base branch ``` Using vendor name old time/op new time/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 1.81µs ±23% 1.75µs ±18% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 974ns ± 4% 947ns ± 1% ~ (p=0.198 n=5+5) DecoderFunc_Decode-2 2.66µs ± 4% 2.61µs ± 2% ~ (p=0.310 n=5+5) Decoder_Decode_json-2 31.0µs ± 3% 29.9µs ± 4% ~ (p=0.056 n=5+5) Decoder_Decode_queryObject-2 7.07µs ± 4% 6.89µs ± 2% ~ (p=0.095 n=5+5) Decoder_Decode_jsonParam-2 2.44µs ± 2% 2.50µs ± 0% +2.67% (p=0.048 n=5+4) DecoderFactory_SetDecoderFunc-2 2.11µs ± 1% 2.15µs ± 2% +1.87% (p=0.016 n=5+5) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 15.0µs ± 2% 15.1µs ± 3% ~ (p=0.548 n=5+5) Middleware_control-2 4.24µs ± 1% 4.15µs ± 2% ~ (p=0.087 n=5+5) name old alloc/op new alloc/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 2.50kB ± 0% 2.50kB ± 0% ~ (all equal) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 448B ± 0% 448B ± 0% ~ (all equal) DecoderFunc_Decode-2 1.51kB ± 0% 1.51kB ± 0% ~ (all equal) Decoder_Decode_json-2 12.4kB ± 0% 12.4kB ± 0% ~ (p=0.556 n=5+4) Decoder_Decode_queryObject-2 2.00kB ± 0% 2.00kB ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 752B ± 0% 752B ± 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.11kB ± 3% 1.11kB ± 2% ~ (p=0.937 n=5+5) 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 169 ± 0% 169 ± 0% ~ (all equal) Decoder_Decode_queryObject-2 36.0 ± 0% 36.0 ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 12.0 ± 0% 12.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) ```

Examples Benchmark Result

Benchmark diff with base branch ``` Using vendor name old time/op new time/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 27.0µs ± 3% 26.9µs ± 3% ~ (p=0.841 n=5+5) _directGzipHead-2 27.2µs ± 1% 26.3µs ± 4% ~ (p=0.095 n=5+5) _noDirectGzip-2 153µs ± 2% 150µs ± 2% ~ (p=0.095 n=5+5) _directGzip_decode-2 570µs ± 2% 543µs ± 2% -4.74% (p=0.008 n=5+5) _noDirectGzip_decode-2 154µs ± 2% 150µs ± 3% ~ (p=0.056 n=5+5) _jsonBody-2 34.7µs ± 2% 33.0µs ± 3% -4.96% (p=0.016 n=5+5) _jsonBodyValidation-2 58.6µs ± 3% 56.1µs ± 2% -4.24% (p=0.016 n=5+5) _outputHeaders-2 27.0µs ± 1% 25.9µs ± 3% -4.08% (p=0.008 n=5+5) _validation-2 53.4µs ± 3% 52.8µs ± 5% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 34.6µs ± 8% 31.7µs ± 2% -8.30% (p=0.008 n=5+5) _ok-2 35.0µs ± 3% 34.4µs ± 2% ~ (p=0.151 n=5+5) _invalidBody-2 49.1µs ± 3% 47.9µs ± 3% ~ (p=0.151 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 639 ± 0% 639 ± 0% ~ (all equal) _directGzipHead-2 183 ± 0% 183 ± 0% ~ (all equal) _noDirectGzip-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _directGzip_decode-2 639 ± 0% 639 ± 0% ~ (all equal) _noDirectGzip_decode-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _jsonBody-2 194 ± 0% 194 ± 0% ~ (all equal) _jsonBodyValidation-2 194 ± 0% 194 ± 0% ~ (all equal) _outputHeaders-2 155 ± 0% 155 ± 0% ~ (all equal) _validation-2 177 ± 0% 177 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 337 ± 0% 337 ± 0% ~ (all equal) _ok-2 359 ± 0% 359 ± 0% ~ (p=0.444 n=5+5) _invalidBody-2 435 ± 0% 435 ± 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 181 ± 0% 181 ± 0% ~ (all equal) _jsonBodyValidation-2 192 ± 0% 192 ± 0% ~ (all equal) _outputHeaders-2 77.0 ± 0% 77.0 ± 0% ~ (all equal) _validation-2 170 ± 0% 170 ± 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 37.0k ± 3% 37.2k ± 3% ~ (p=0.841 n=5+5) _directGzipHead-2 36.8k ± 1% 38.0k ± 4% ~ (p=0.095 n=5+5) _noDirectGzip-2 6.56k ± 2% 6.65k ± 2% ~ (p=0.095 n=5+5) _directGzip_decode-2 1.75k ± 2% 1.84k ± 2% +4.96% (p=0.008 n=5+5) _noDirectGzip_decode-2 6.51k ± 2% 6.67k ± 3% ~ (p=0.056 n=5+5) _jsonBody-2 28.8k ± 2% 30.3k ± 3% +5.24% (p=0.016 n=5+5) _jsonBodyValidation-2 17.1k ± 3% 17.8k ± 2% +4.40% (p=0.016 n=5+5) _outputHeaders-2 37.0k ± 1% 38.6k ± 3% +4.28% (p=0.008 n=5+5) _validation-2 18.7k ± 3% 19.0k ± 5% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 29.0k ± 7% 31.6k ± 2% +8.91% (p=0.008 n=5+5) _ok-2 28.6k ± 3% 29.1k ± 2% ~ (p=0.151 n=5+5) _invalidBody-2 20.4k ± 3% 20.9k ± 3% ~ (p=0.151 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.81kB ± 0% -1.22% (p=0.008 n=5+5) _directGzipHead-2 3.86kB ± 0% 3.81kB ± 0% -1.23% (p=0.008 n=5+5) _noDirectGzip-2 6.31kB ±20% 5.92kB ±16% ~ (p=0.222 n=5+5) _directGzip_decode-2 403kB ± 0% 402kB ± 0% -0.03% (p=0.008 n=5+5) _noDirectGzip_decode-2 5.22kB ± 5% 5.30kB ±10% ~ (p=0.548 n=5+5) _jsonBody-2 5.98kB ± 0% 5.93kB ± 0% -0.82% (p=0.008 n=5+5) _jsonBodyValidation-2 18.2kB ± 0% 18.2kB ± 0% -0.26% (p=0.008 n=5+5) _outputHeaders-2 3.64kB ± 0% 3.59kB ± 0% -1.35% (p=0.008 n=5+5) _validation-2 16.2kB ± 0% 16.1kB ± 0% -0.30% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 5.65kB ± 0% 5.60kB ± 0% -0.88% (p=0.008 n=5+5) _ok-2 5.56kB ± 0% 5.51kB ± 0% -0.90% (p=0.029 n=4+4) _invalidBody-2 9.47kB ± 0% 9.42kB ± 0% -0.50% (p=0.029 n=4+4) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 40.0 ± 0% 39.0 ± 0% -2.50% (p=0.008 n=5+5) _directGzipHead-2 40.0 ± 0% 39.0 ± 0% -2.50% (p=0.008 n=5+5) _noDirectGzip-2 47.8 ± 4% 46.8 ± 4% ~ (p=0.151 n=5+5) _directGzip_decode-2 497 ± 0% 496 ± 0% -0.20% (p=0.008 n=5+5) _noDirectGzip_decode-2 48.0 ± 0% 47.0 ± 0% -2.08% (p=0.008 n=5+5) _jsonBody-2 57.0 ± 0% 56.0 ± 0% -1.75% (p=0.008 n=5+5) _jsonBodyValidation-2 144 ± 0% 143 ± 0% -0.69% (p=0.008 n=5+5) _outputHeaders-2 35.0 ± 0% 34.0 ± 0% -2.86% (p=0.008 n=5+5) _validation-2 131 ± 0% 130 ± 0% -0.76% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 63.0 ± 0% 62.0 ± 0% -1.59% (p=0.008 n=5+5) _ok-2 59.0 ± 0% 58.0 ± 0% -1.69% (p=0.029 n=4+4) _invalidBody-2 109 ± 0% 108 ± 0% -0.92% (p=0.029 n=4+4) ```