Repository navigation
Fix idle pruning with sampling based implementation - #2631
Conversation
ae9ef7d to
1312d09
Compare
Has minimal hot path locking but could be reduced by removing timer enable/disable entirely
1312d09 to
07b772b
Compare
YohDeadfall
left a comment
There was a problem hiding this comment.
Looks good, thank you for your work! Let's address some nits before merging.
roji
left a comment
There was a problem hiding this comment.
Looks great, thanks! See some comments but nothing major, it's great that pruning is (almost) totally external to our critical paths now. Much better than before.
Ideally I'd rip this Enable/Disable from any allocate/release flows and replace it with some timer logic that uses a back-off period instead, what do you think @roji?
Yeah, that would remove pruning completely from the critical flows. But the way you currently do it, there's only one simple comparison of openCount to _min to allocate/release, which should really be negligible. I'd rather merge as-is now for 4.1 and revisit (if at all) later...
Also I haven't removed ReleaseTimestamp from Connector yet, now that it's not used anymore should I do that?
Kill it 😈
|
@NinoFloris once you're happy with it let me know and I'll merge for you. |
|
Happy to see it merged. |
|
Awesome, thanks @NinoFloris! |
|
Hi, @NinoFloris Is this fix released, and if so what is the version? |
|
@waelemara as you can see on the issue for this PR (#2224), this was released as part of 4.1.0. |
|
@roji yup thanks for that, it wasn’t clear at the beginning, appreciate your response. |
Fixes idle pruning with sampling based implementation.
This type of manual reset/reactivation timer has a smaller lock range and no need for array copies compared to one where you'd have to worry about overlapping callbacks.
There's one possible case where enable/disable is called right when the median is calculated that might take a bit longer than we want but that entirely depends on the sample size to sort.
Ideally I'd rip this Enable/Disable from any allocate/release flows and replace it with some timer logic that uses a back-off period instead, what do you think @roji?
Also I haven't removed ReleaseTimestamp from Connector yet, now that it's not used anymore should I do that?
Fixes #2224.