LB write returns iterator to the element#106
Open
denizergonul wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
(Self) CPU times for base: (Self) CPU times for development: Profiling results show that performance is mostly improved. |
Contributor
Author
Member
|
My main worry is the IterableQueueModel's new write implementation at very high insertion rates. I would like to see a profile run with high insertion rates. |
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.

Immediate postprocessing was being done for
buffer->back()assuming that is the last written element into the buffer. Although it is correct for queues, it is false for skip list since skip list is a sorted buffer; meaning that, if elements arrive out-of-order,back()can remain the same.With the current API there was no way to get the last written element to skip list. Actually, folly's skip list
insertfunction does return an iterator but we were not making use of it.With this change, our latency buffer
writefunctions now return an iterator as well. Then postprocessing is called with the correct element.Unit tests are added for
IterableQueueModelandSkipListLatencyBufferModelto test simple scenarios.The main change:
Before:
bool write(T&& element);After:
std::pair<const T*, bool> write(T&& element);Side change:
IterableQueueModel's constructor which only takessizeparameter does not compile (because the other constructor has the following parameters defaulted which causes ambiguity) so it is removed.