Skip to content

Improves performance of json_stream_parser.cc by factor 1000#7230

Merged
acozzette merged 2 commits intoprotocolbuffers:masterfrom
wsw2016:master
Feb 19, 2020
Merged

Improves performance of json_stream_parser.cc by factor 1000#7230
acozzette merged 2 commits intoprotocolbuffers:masterfrom
wsw2016:master

Conversation

@wsw2016
Copy link
Copy Markdown
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.

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
Copy link
Copy Markdown

Thanks, @wsw2016!

@yoavmil
Copy link
Copy Markdown
Contributor

yoavmil commented May 8, 2020

In which release is this fix included?

@arhuaco
Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants