Replace standard encoding/json with goccy/go-json#1153
Closed
qasim-nylas wants to merge 7 commits intocloudevents:mainfrom
Closed
Replace standard encoding/json with goccy/go-json#1153qasim-nylas wants to merge 7 commits intocloudevents:mainfrom
qasim-nylas wants to merge 7 commits intocloudevents:mainfrom
Conversation
Signed-off-by: Qasim <qasim.m@nylas.com>
Signed-off-by: Qasim <qasim.m@nylas.com>
Signed-off-by: Qasim <qasim.m@nylas.com>
…ency Signed-off-by: Qasim <qasim.m@nylas.com>
Signed-off-by: Qasim <qasim.m@nylas.com>
Signed-off-by: Qasim <qasim.m@nylas.com>
…json Signed-off-by: Qasim <qasim.m@nylas.com>
Member
|
Hi, this comes somewhat out of the blue for me. Was this discussed in a meeting or is there an issue that I can read to understand why we are introducing another dependency? Do we have users complaining about performance issues with the existing encoders? Also, the Go community is moving to JSON v2 which also promised performance improvements with API compatibility - and without adding new dependencies which I'm not keen to add more to this project given its importance and reliance from many users and enterprises, unless strictly needed. Our CONTRIBUTING guide describes the typical flow for this project: https://github.com/cloudevents/sdk-go/blob/main/CONTRIBUTING.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR replaces the standard library
encoding/jsonpackage withgithub.com/goccy/go-jsonin key performance-sensitive areas while maintaining compatibility with existing code. This change significantly improves JSON marshaling and unmarshaling performance.Changes
github.com/goccy/go-jsonas a dependency ingo.modevent/datacodec/json/data.goto use goccy/go-jsonbinding/format/format.goto use goccy/go-jsonPerformance Improvements
JSON Marshal Performance
JSON Unmarshal Performance
Summary of Improvements:
Notes
Testing
All tests in the v2 module pass successfully. The added benchmarks demonstrate significant performance improvements.