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

Improves performance of json_stream_parser.cc by factor 1000 #7230

Merged
merged 2 commits into from Feb 19, 2020

Conversation

wsw2016
Copy link
Contributor

@wsw2016 wsw2016 commented Feb 18, 2020

JsonStreamParser::GetNextTokenType() uses HasPrefixString a lot on StringPiece as input. For each call two std::strings are constructed, compared and destroyed. Parsing of json-files with 50-60 MB in debug mode takes minutes.

With this modification the speed is comparable with other Json parsers.

wsw2016 added 2 commits Feb 18, 2020
JsonStreamParser::GetNextTokenType() uses HasPrefixString a lot on StringPiece as input. For each call two std::strings are constructed, compared and destroyed. Parsing of json-files with 50-60 MB in debug mode takes minutes.
Improves performance of json_stream_parser.cc by factor 1000
@acozzette acozzette self-assigned this Feb 19, 2020
@acozzette acozzette added kokoro:run release notes: yes labels Feb 19, 2020
@acozzette acozzette merged commit b96241b into protocolbuffers:master Feb 19, 2020
53 of 56 checks passed
@acozzette
Copy link
Member

@acozzette acozzette commented Feb 19, 2020

Thanks, @wsw2016!

@yoavmil
Copy link
Contributor

@yoavmil yoavmil commented May 8, 2020

In which release is this fix included?

@arhuaco
Copy link

@arhuaco arhuaco commented May 9, 2020

In which release is this fix included?

v3.12.0-rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ cla: yes release notes: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants