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

Native histogram performance #4244

Merged
merged 6 commits into from
Nov 1, 2024

Conversation

zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Oct 29, 2024

What this PR does:

Improve performance in the native histograms implementations. This is following in the footsteps of #4232.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@zalegrala
Copy link
Contributor Author

zalegrala commented Oct 29, 2024

❯ benchstat main.txt wip.txt
goos: linux
goarch: amd64
pkg: github.com/grafana/tempo/modules/generator
cpu: AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
           │   main.txt   │               wip.txt               │
           │    sec/op    │   sec/op     vs base                │
Collect-16   4.960µ ± 10%   4.421µ ± 5%  -10.86% (p=0.002 n=10)

           │  main.txt   │              wip.txt               │
           │ heap_in_use │ heap_in_use  vs base               │
Collect-16   17.81M ± 1%   17.42M ± 1%  -2.16% (p=0.000 n=10)

           │   main.txt   │               wip.txt               │
           │     B/op     │     B/op      vs base               │
Collect-16   14.22Ki ± 3%   13.59Ki ± 3%  -4.44% (p=0.000 n=10)

           │  main.txt   │            wip.txt            │
           │  allocs/op  │  allocs/op   vs base          │
Collect-16   40.00 ± 40%   31.00 ± 35%  ~ (p=0.137 n=10)

I'm seeing some randomness in the benchmarks, which makes is less reliable for comparison.

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

some Qs but i think it looks great

modules/generator/registry/native_histogram.go Outdated Show resolved Hide resolved
modules/generator/registry/native_histogram.go Outdated Show resolved Hide resolved
modules/generator/registry/registry.go Show resolved Hide resolved
Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

Let's go!

@zalegrala zalegrala merged commit ffeaac7 into grafana:main Nov 1, 2024
16 checks passed
@zalegrala zalegrala deleted the nativeHistogramPerformance branch November 1, 2024 13:48
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