-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issues/16: gzip middleware #36
Conversation
Codecov Report
@@ Coverage Diff @@
## main #36 +/- ##
==========================================
- Coverage 79.36% 76.34% -3.03%
==========================================
Files 9 10 +1
Lines 475 575 +100
==========================================
+ Hits 377 439 +62
- Misses 92 117 +25
- Partials 6 19 +13
Continue to review full report at Codecov.
|
type gzipRW struct { | ||
http.ResponseWriter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not wrap responseWriter since it breaks optional interfaces
rs/cors#84 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goos: linux goarch: amd64 pkg: github.com/komuw/goweb/middleware cpu: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz BenchmarkGoWebGzip-8 10 102_841_804 ns/op 4_408_804 B/op 112 allocs/op (this repo) BenchmarkKlauspostGzip-8 7 147_835_846 ns/op 3_481_233 B/op 108 allocs/op BenchmarkNytimesGzip-8 4 315_542_409 ns/op 3_610_360 B/op 110 allocs/op BenchmarkTmthrgdGzip-8 4 313_606_704 ns/op 2_916_530 B/op 105 allocs/op BenchmarkNoGzip-8 20 55_108_066 ns/op 3_038_690 B/op 76 allocs/op
@@ -0,0 +1,5456 @@ | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file taken from: https://github.com/klauspost/compress/blob/v1.15.6/gzhttp/testdata/benchmark.json
which is licensed under Apache License Version 2.0
; https://github.com/klauspost/compress/blob/v1.15.6/gzhttp/LICENSE
fixes: #16