Remove O(N^2) algorithm from repeated field extraction.#51
Merged
seancribbs merged 1 commit intomasterfrom Jun 19, 2013
Merged
Conversation
In messages with many values for a repeated field, lists:reverse/1 is called many times, resulting in large amounts of garbage and an unreasonable amount of time spent in decoding. This moves the list reversal until the end of the decoding, only once per repeated field.
Author
|
Additional info: Customer ticket: https://basho.zendesk.com/agent/#/tickets/4704 |
Contributor
|
Confirmed that this drops a 61k-result 2i query on a 3-laptop-node cluster from 14 seconds down to half a second. There also seems to be no measurable slowdown to decoding of messages that do not have large repeated fields. Note to other potential reviewers: just recompiling Also confirmed that these tests still pass with this patch on both server and client side:
Looks good to me. +1 |
Author
|
Thanks @beerriot! |
seancribbs
pushed a commit
that referenced
this pull request
Jun 19, 2013
Remove O(N^2) algorithm from repeated field extraction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In messages with many values for a repeated field,
lists:reverse/1is called many times, resulting in large amounts of garbage and an unreasonable amount of time spent in decoding. This moves the list reversal until the end of the decoding, only once per repeated field.This issue was found when a customer did a 2I query returning ~150K results. Ideally this should make it into the "0.8.1" tag and Riak 1.4, although it primarily affects the client-side.