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

Issues/16: gzip middleware #36

Merged
merged 25 commits into from
Jun 21, 2022
Merged

Issues/16: gzip middleware #36

merged 25 commits into from
Jun 21, 2022

Conversation

komuw
Copy link
Owner

@komuw komuw commented Jun 20, 2022

fixes: #16

note: Im not making any claims about which is faster or not.

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
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

@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2022

Codecov Report

Merging #36 (6c3ffc8) into main (99416d7) will decrease coverage by 3.02%.
The diff coverage is 62.00%.

@@            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     
Impacted Files Coverage Δ
middleware/gzip.go 62.00% <62.00%> (ø)

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 99416d7...6c3ffc8. Read the comment docs.

Comment on lines +116 to +117
type gzipRW struct {
http.ResponseWriter
Copy link
Owner Author

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)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@komuw komuw changed the title Issues/16 Issues/16: gzip middleware Jun 20, 2022
komuw added 12 commits June 20, 2022 19:51
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 @@
[
Copy link
Owner Author

@komuw komuw Jun 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@komuw komuw merged commit 2c223a8 into main Jun 21, 2022
@komuw komuw deleted the issues/16 branch June 21, 2022 04:19
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.

add gzip
2 participants