Add a benchmark for the numeric facet builder and use sort.Sort in it (just like for the terms one) #134
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.
I am not 100% sure that the benchmark is measuring the right thing so some checking would be advised. In its current form it adds 10/100/1000 ranges to the range facet builder and then updates it with a very limited set of 4 prefix coded values over and over again. Afterwards it measures how long the Result() function takes to return its result.
If the benchmark is indeed mimicking real world uses, using the slice-based Result()-implementation is a net win just like with the term facet builder. Here are the numbers (on my i7 under Linux).
Old (using a list):
New (using sort.Sort):