Repository navigation
Allow Merge Queue To Handle Larger Inputs - #2400
Merged
Merged
Conversation
Signed-off-by: Matthew Eldridge <[email protected]>
Signed-off-by: Matthew Eldridge <[email protected]>
Signed-off-by: Matthew Eldridge <[email protected]>
Member
|
It would be interesting to see how this method now performs. Old runs are in |
Member
Author
BeforeAfter |
lossyrob
suggested changes
Oct 2, 2017
|
|
||
| class MergeQueue(initialSize: Int = 1) { | ||
| private val treeSet = new java.util.TreeSet(new RangeComparator()) // Sorted data structure | ||
| private val fudge = 1 // Set this to one to preserve original behavior |
Member
There was a problem hiding this comment.
What does this mean? What is the original behavior vs the non-original behavior, and why did it change?
Consider a more clear name for the variable.
Member
Author
|
Ah yes, I realized that I used the phrase "preservation of previous behavior" in two unrelated ways. The first refers to the fact that in the original code, not just overlapping intervals but intervals that have a gap between them of up to one unit are merged. The second usage refers to the fact that one can request the merged intervals more than once, so a the data structure needs to be preserved. I will make an update in a few moments. |
lossyrob
approved these changes
Oct 4, 2017
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.
These changes simplify
MergeQueueand improve its efficiency. Thank you to @mteldridge for noticing this issue.Connects #2358