-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
perf: Speed up parsing of a huge query with a lot of conditional mutations #7871
perf: Speed up parsing of a huge query with a lot of conditional mutations #7871
Conversation
Hey @Phill240 , this looks good. Thanks for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Nice change. 🎉
Please address the comments and then we can proceed with merging this,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Thanks, @Phill240 ! 🎉 |
If a mutation has a lot of conditional mutations, this PR will speed up the parsing of the query. cherry-pick of PR (#7871)
If a mutation has a lot of conditional mutations, this PR will speed up the parsing of the query. cherry-pick of PR (#7871)
If a mutation has a lot of conditional mutations, this PR will speed up the parsing of the query. cherry-pick of PR (#7871)
If a mutation has a lot of conditional mutations, this PR will speed up the parsing of the query. cherry-pick of PR (#7871)
If a mutation has a lot of conditional mutations, this PR will speed up the parsing of the query. cherry-pick of PR (#7871)
Recently I faced a situation when my queries containing a lot of conditional mutations (+5000) took a long time to process. According to the servers reply the slowest part of the query handling was parsing. For example:
parsing_ns:835833349 processing_ns:157596840 encoding_ns:5105536 assign_timestamp_ns:454011 total_ns:1033841289
So the parsing took several times longer that the processing itself!
The reason of the issue is in the ineffective implementation of buildUpsertQuery method. I suggest using String Builder instead of just simple string concatenation. After these changes the parsing speed increased significantly:
parsing_ns:134053025 processing_ns:114263143 encoding_ns:4992320 assign_timestamp_ns:495987 total_ns:286159717
This change is