-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/json: prevent compact twice to improve precomputed performance. #35320
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
Conversation
This PR (HEAD: 09c4cb6) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/205018 to see it. Tip: You can toggle comments from me using the |
Message from Gobot Gobot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/205018. |
Message from Daniel Martí: Patch Set 1: Code-Review-2 Sorry, but adding options to the API needs to be decided in the issue tracker first. Perhaps file a proposal. I don't think this idea has a high chance of being accepted though, because encoding/json prioritizes simplicity and correctness over speed. Please don’t reply on this GitHub thread. Visit golang.org/cl/205018. |
Message from Orange Orange: Patch Set 1:
I got that encoding/json prioritizes simplicity and correctness over speed. Please don’t reply on this GitHub thread. Visit golang.org/cl/205018. |
Message from Go Bot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/205018. |
Message from Daniel Martí: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/205018. |
This PR is being closed because golang.org/cl/205018 has been abandoned. Clearing my incoming reviews queue. |
related issue: #33422
JSON encoder will run compact on output of Marshaler anyway to confirm correctness of result.
But struct with many embed precomputed Marshaler resulting in poor performance by compact several times.
For example, json.RawMessage is designed to precompute a JSON encoding but it did not work as desiged.