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

chore: improve GetQueryMap performance. #1918

Merged
merged 1 commit into from
May 29, 2019
Merged

Conversation

appleboy
Copy link
Member

See the benchmark results:

$ go test -benchmem -run=^$ github.com/gin-gonic/gin -bench ^BenchmarkGetQueryMap
goos: darwin
goarch: amd64
pkg: github.com/gin-gonic/gin
BenchmarkGetQueryMapOld-4        1000000              1810 ns/op             880 B/op         11 allocs/op
BenchmarkGetQueryMapNew-4        3000000               404 ns/op             336 B/op          2 allocs/op
PASS
ok      github.com/gin-gonic/gin        4.442s

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy appleboy added this to the 1.5 milestone May 29, 2019
@codecov
Copy link

codecov bot commented May 29, 2019

Codecov Report

Merging #1918 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1918      +/-   ##
==========================================
+ Coverage   98.75%   98.75%   +<.01%     
==========================================
  Files          38       38              
  Lines        2164     2167       +3     
==========================================
+ Hits         2137     2140       +3     
  Misses         15       15              
  Partials       12       12
Impacted Files Coverage Δ
context.go 98.4% <100%> (+0.01%) ⬆️

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 233a3e4...7d19e12. Read the comment docs.

@thinkerou thinkerou self-requested a review May 29, 2019 06:54
Copy link
Member

@thinkerou thinkerou left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@thinkerou thinkerou merged commit 4b6df41 into gin-gonic:master May 29, 2019
@appleboy appleboy deleted the improve branch May 29, 2019 07:13
ThomasObenaus pushed a commit to ThomasObenaus/gin that referenced this pull request Feb 19, 2020
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants