-
Notifications
You must be signed in to change notification settings - Fork 569
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
MQE: eliminate loops in BucketedPool
#10199
Conversation
c91d886
to
21627e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be curious to see a benchmark for this if possible please :-).
Also, regarding the power of 2 checks in the buffer, we could grow the capacity of the returned slice to the next power of 2. It doesn't help the pool or anything, but we can still potentially process it. We'd need some kind of additional limit for reasonableness though so it might not be worth it so long as the pool sizes are reasonable themselves.
I think the pool sizes are already reasonable themselves - and if we start running into this in the real world then we can easily adjust the pool limit. |
Most of our benchmarks see very mild impact (<1%), but for queries with many steps and many series, the impact is noticeable:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat, thanks!
This introduced a bug fixed in #10261 |
* MQE: eliminate loops in `BucketedPool` * Don't panic in `Append` or `Use` if slice does not have capacity that is a power of two * Address PR feedback: elaborate on comments
What this PR does
This PR eliminates the use of loops in
BucketedPool
. This gives a very mild speedup (<1%) to queries with many steps and many series.It also removes the panics in both ring buffer's
Append
andUse
methods. It's possible that the conditions that previously would have caused a panic could happen in the real world if a subquery selected enough points that it exceeded the maximum size of a slice returned from theFPoint
orHPoint
pool, so it seems safer to return an error here rather than crashing the process.Which issue(s) this PR fixes or relates to
(none)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.