-
Notifications
You must be signed in to change notification settings - Fork 822
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
encoding/json: Add Custom JSON Package with Build Tag Support for Sonic #1623
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1623 +/- ##
=======================================
Coverage 37.07% 37.07%
=======================================
Files 414 414
Lines 180274 180274
=======================================
+ Hits 66835 66845 +10
- Misses 105574 105577 +3
+ Partials 7865 7852 -13
|
Flagged this as medium because this is beast. Sorry for those that cant use it. 🙏 |
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.
.github/workflows/tests.yml
Outdated
- os: windows-latest | ||
goarch: amd64 | ||
psql: true | ||
skip_wrapper_tests: true | ||
sonic: false | ||
- os: ubuntu-latest-sonic |
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.
I think you should stick to the same style as the existing builds names with the false, false,false,true
, would also just be fine with including sonic
somewhere in the build name. Maybe its just not showing up below because its not merged?
Also, do we need two of each build? Would one extra one with sonic enabled suffice?
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.
I think you should stick to the same style as the existing builds names with the false, false,false,true, would also just be fine with including sonic somewhere in the build name. Maybe its just not showing up below because its not merged?
That should have been reverted. I think.
Also, do we need two of each build? Would one extra one with sonic enabled suffice?
@thrasher- Confirming entire suite test or can just have one?
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.
Can target amd64 linux for now since that's our main deployment OS in use ATM
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.
@@ -13,22 +13,52 @@ jobs: | |||
goarch: amd64 |
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.
Unrelated to this line, would you consider a log on GCT start to say which one is enabled? Yes, you have build tags, but then it puts it in the logs of the application
Could add to the build tag files to call like json.Version()
where its fmt.Println("hello my name is Sonic and I gotta go fast, okay?")
as an example
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.
PR Description
This pull request introduces a custom JSON package located in encoding/json/ to facilitate swapping between the default Go encoding/json package and the sonic library based on build tags.
Adds:
Import Updates:
All imports to the standard encoding/json package have been updated to the new custom package github.com/thrasher-corp/gocryptotrader/encoding/json.
Added basic benchmarks for both the default encoding/json and the sonic implementation to evaluate hot-swap performance.
Type of change
Please delete options that are not relevant and add an
x
in[]
as item is complete.How has this been tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and
also consider improving test coverage whilst working on a certain feature or package.
Checklist