-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/json: reduce the number of allocations when decoding in streaming mode (Token API) #56307
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
…aming mode (Token API) When the scanner is used by the Token API it always resets the state before so that the scanner behaves as if it was parsing a top-level value, which causes it to allocate and set the 'err' field because the following character is not a space. This error value is completely unnecessary because it's dropped by the next invocation of readValue(). Fixes golang#56299
This PR (HEAD: 9d4e68d) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/443778 to see it. Tip: You can toggle comments from me using the |
Message from Gopher Robot: 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/443778. |
Message from Joe Tsai: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/443778. |
Message from Joe Tsai: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/443778. |
Message from Dmitry Panov: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/443778. |
Message from Joe Tsai: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/443778. |
Message from Dmitry Panov: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/443778. |
Message from Joe Tsai: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/443778. |
When the scanner is used by the Token API it always resets the state before so that the scanner behaves as if it was parsing a top-level value, which causes it to allocate and set the 'err' field because the following character is not a space. This error value is completely unnecessary because it's dropped by the next invocation of readValue().
Fixes #56299