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

High CPU usage when decode json string contains numerous '\' #501

Open
igotcha opened this issue Mar 2, 2024 · 2 comments
Open

High CPU usage when decode json string contains numerous '\' #501

igotcha opened this issue Mar 2, 2024 · 2 comments

Comments

@igotcha
Copy link

igotcha commented Mar 2, 2024

When json string contains numerous '\' (eg: Windows file path), "decoder.decodeEscapeString" will do too many memory move works.
This is my pprof graph:
image
And I think the problem is here

@HaoKunT
Copy link

HaoKunT commented Mar 5, 2024

I have meet the same problem.

@jamiecuthill
Copy link

Also seeing a difference in parsing large JSON blobs with escaped JSON embedded within a string value but only whilst using the Decoder.

As soon as I remove the nested escaped JSON the Decoder performance is much closer to Unmarshal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants