-
Notifications
You must be signed in to change notification settings - Fork 636
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
sdk/metrics: performance impact of exemplars support even when configured as always_off
#4243
Comments
always_off
always_off
Info from analysis by @emdneto and discussed between us on Slack:
|
The problem also is if we have several different aggregations (for example, when generating metrics with dynamic attributes), it will create several reservoirs with several ExemplarsBuckets. On the other hand, each aggregation is created with the reference for theReservoirFactory. Since the benchmark test run with dynamic attributes, it explains the huge drop in metrics-sdk benchmark. Image of a benchmark test run using EXEMPLAR_FILTER=always_off TLDR; So, at least, I expect if the Exemplar's feature is disabled (always_off), there's no need to instantiate a FixedSizeReservoir every time a new aggregation is created. So maybe we can have a NoOpReservoir instead when the exemplar filter is always_off. |
@emdneto when you say dynamic attributes, you mean the benchmark is generating changing attributes for each iteration vs using the same attribute set each time?
This seems like a reasonable optimization. Not sure if it's better, but we could make the FixedSizeReservoir behave more lazily. That profile points to the constructor which eagerly generates it's reservoir Lines 158 to 160 in 43804f3
|
I would also benchmark this again after #4251 because it fixed |
|
With this I get a bit less than 2x loops in always_off and trace_based running
|
@fcollonval please take a look at #4260 |
After d5fb2c4 got merged we had a huge drop on iter/sec in metrics SDK benchmark for all metric types:
It seems expected when the Exemplars feature is enabled (the default behavior), but according to the spec, setting the exemplar filter to
always_off
shouldn't introduce any overhead. Running the benchmark locally, we still have the same overhead even when "disabling" (set toalways_off
) the Exemplars feature.Benchmark Results Summary
The text was updated successfully, but these errors were encountered: