Skip to content

Native histogram performance#4244

Merged
zalegrala merged 6 commits intografana:mainfrom
zalegrala:nativeHistogramPerformance
Nov 1, 2024
Merged

Native histogram performance#4244
zalegrala merged 6 commits intografana:mainfrom
zalegrala:nativeHistogramPerformance

Conversation

@zalegrala
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

@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

Comment thread modules/generator/registry/native_histogram.go
Comment thread modules/generator/registry/native_histogram.go Outdated
Comment thread modules/generator/registry/native_histogram.go
Comment thread modules/generator/registry/native_histogram.go Outdated
Comment thread modules/generator/registry/registry.go
Copy link
Copy Markdown
Collaborator

@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
@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