-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Add build tag nomsgpack #1852
Add build tag nomsgpack #1852
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1852 +/- ##
=========================================
+ Coverage 98.49% 98.5% +0.01%
=========================================
Files 40 41 +1
Lines 2256 2276 +20
=========================================
+ Hits 2222 2242 +20
Misses 18 18
Partials 16 16
Continue to review full report at Codecov.
|
Using the basic example :
Without the I used |
sounds good for ci. any update here? |
@sapk Could you resolve the conflicts? |
@lunny done |
@sapk :) |
@thinkerou what do you think about this PR? |
To re-validate, I re-did the size bench after last rebase.
|
binding/binding_nomsgpack.go
Outdated
@@ -0,0 +1,111 @@ | |||
// Copyright 2014 Manu Martinez-Almeida. All rights reserved. |
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.
- please update copyright
- filename:
binding_nomsgpack.go
binding_msgpack_test.go
, should we usexxx_msgpack_xxx
? - the file and
binding.go
have repeat code, should we use reduce?
thanks!
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.
// Copyright 2014 Manu Martinez-Almeida. All rights reserved. | |
// Copyright 2020 Gin Core Team. All rights reserved. |
I will have fresh look on removing/refactor duplicate code later.
maybe need another PR to update documentation. |
@lunny for the doc you mean in the README.md ? |
* add build tag nomsgpack * Update copyright * Update copyright
* add build tag nomsgpack * Update copyright * Update copyright
I hear that msgpack‘s performance is better than json. |
I'm loving this change and I'm glad it was made because I just did the math and calculated that it will save a company actual money. |
This PR add a build tag
nomsgpack
to exclude heavy depsgithub.aaakk.us.kg/ugorji/go/codec
that may be not needed for most project. The goal is to reduce the resulting binary size. This could maybe improve some performances but that not the goal so I haven't bench it.I go for the no impact by default by using a negate tag so that without change it will not impact project depending on this lib.
I will try to provide some results of binary size based on https://github.com/gin-gonic/examples.-> see commentShould fix (or at least a mitigation to) #1847