Skip to content
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: do all reflect work before decoding #16212

Open
josharian opened this issue Jun 29, 2016 · 4 comments
Open

encoding/json: do all reflect work before decoding #16212

josharian opened this issue Jun 29, 2016 · 4 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. Performance
Milestone

Comments

@josharian
Copy link
Contributor

@crawshaw commented in CL 24472:

With more time and care, I believe more of the JSON decoder's work could be shifted so it is done before decoding, and independent of the number of bytes processed. Maybe someone could explore that for Go 1.8.

This issue is a reminder, because CLs get forgotten.

@josharian josharian added this to the Go1.8Maybe milestone Jun 29, 2016
@josharian
Copy link
Contributor Author

Hey @sctb, I promised to pester you when the 1.8 tree opened up again, and offer some more bad advice about what issues to work on. This one is pretty vague and likely to be a bit gnarly, so...a perfect terrible recommendation for you. :) Happy to suggest others as well, depending on what part of the world you care about this month...

@sctb
Copy link
Contributor

sctb commented Aug 26, 2016

@josharian Sounds just right, I'll take a look!

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 10, 2016
@rsc rsc modified the milestones: Unplanned, Go1.8Maybe Oct 20, 2016
@mvdan
Copy link
Member

mvdan commented Aug 31, 2018

I've closed the broad json performance issue #5683 in favor of more specific performance issues about the encoder and decoder. This is the obvious first choice - the decoder is way slower than the encoder, and reflection is the obvious culprit.

I imagine that doing this, especially for structs, would give a noticeable speed-up. I might give this a look during the current 1.12 cycle.

@mvdan
Copy link
Member

mvdan commented Nov 22, 2018

I no longer think this should be the priority to speed up JSON decoding. I think we should consider #28923 first, since the scanner takes vastly more time than any decoding work involving reflection.

I still think we should do this at some point, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Performance
Projects
None yet
Development

No branches or pull requests

6 participants