Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeQuery benchmark optimizations #1413

Merged
merged 3 commits into from
Dec 13, 2019
Merged

RangeQuery benchmark optimizations #1413

merged 3 commits into from
Dec 13, 2019

Conversation

pstibrany
Copy link
Member

Couple of small optimizations for RangeQuery benchmark.

$ benchstat orig.txt new.txt 
name                 old time/op    new time/op    delta
RangeQuery100000-4     2.53ms ± 8%    2.28ms ± 4%  -10.00%  (p=0.000 n=10+9)
RangeQuery200000-4     7.23ms ± 8%    5.80ms ± 3%  -19.82%  (p=0.000 n=10+9)
RangeQuery500000-4      2.78s ± 2%     2.29s ± 3%  -17.61%  (p=0.000 n=9+10)
RangeQuery1000000-4     5.54s ± 3%     4.54s ± 3%  -18.07%  (p=0.000 n=10+9)

name                 old alloc/op   new alloc/op   delta
RangeQuery100000-4      290kB ± 3%     254kB ± 1%  -12.53%  (p=0.000 n=9+9)
RangeQuery200000-4      586kB ± 7%     368kB ± 1%  -37.22%  (p=0.000 n=10+9)
RangeQuery500000-4      263MB ± 0%     135MB ± 0%  -48.68%  (p=0.000 n=10+10)
RangeQuery1000000-4     527MB ± 0%     271MB ± 0%  -48.62%  (p=0.000 n=10+10)

name                 old allocs/op  new allocs/op  delta
RangeQuery100000-4      2.95k ± 5%     1.97k ± 0%  -33.07%  (p=0.000 n=9+9)
RangeQuery200000-4      7.64k ± 9%     2.09k ± 0%  -72.65%  (p=0.000 n=10+9)
RangeQuery500000-4      4.14M ± 0%     0.14M ± 0%  -96.72%  (p=0.000 n=10+10)
RangeQuery1000000-4     8.27M ± 0%     0.27M ± 0%  -96.75%  (p=0.000 n=10+10)

Benchmark is also updated to have some duplicate streams, as it didn't have any before.

Signed-off-by: Peter Štibraný <[email protected]>
Also just return first element if there is only one tuple.

Signed-off-by: Peter Štibraný <[email protected]>
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@cyriltovena cyriltovena merged commit f6be636 into grafana:master Dec 13, 2019
@pstibrany pstibrany deleted the optimize-mostCommon branch December 13, 2019 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants