Faster Bucket Lookup For "exact" Linear Histograms
For "exact" linear histograms, the bucket index for Sample |value| can be easily computed and thus we don't need to do a costly binary search for the bucket index. This could have a notable performance improvement given that some histograms (like TaskCount metrics, done after every queued task) can see huge numbers of lookups. the code is already covered by the HistogramFunctionsTest.ExactLinear test. Without this change, running 1 million times the logging part of the above test takes 640ms. With this change, it only takes 530ms which improves ~20% of the bucket lookup performance. Bug: 950536 Change-Id: I1fa9a1cfd0ccbf1967a678ba82b19f15f90c9848 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2328305Reviewed-by:Brian White <bcwhite@chromium.org> Commit-Queue: Brian White <bcwhite@chromium.org> Auto-Submit: Weilun Shi <sweilun@chromium.org> Cr-Commit-Position: refs/heads/master@{#793788}
Showing
Please register or sign in to comment