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

Optimize csp.stats calculations for expanding intervals #247

Merged
merged 1 commit into from
May 23, 2024

Conversation

AdamGlustein
Copy link
Collaborator

As identified by @svatasoiu there is no need to maintain a costly VariableSizedWindowBuffer for expanding windows. It is unnecessary logic and also grows unbounded.

All we need to do is store yet-to-be-released additions in a vector and swap it with the last value when we tick them out (similar approach to how we handle removals for a tick-count specified buffer). This approach a) avoids memory allocation and b) keeps all the sampling logic in the window update nodes.

…aintain a costly VariableSizedWindowBuffer

Signed-off-by: Adam Glustein <Adam.Glustein@Point72.com>
@AdamGlustein AdamGlustein force-pushed the efficient-expanding-window-calculations branch from cf83bec to 1b0f17c Compare May 22, 2024 21:25
@timkpaine timkpaine added the type: enhancement Issues and PRs related to improvements to existing features label May 23, 2024
@AdamGlustein AdamGlustein merged commit 3c365c1 into main May 23, 2024
29 checks passed
@AdamGlustein AdamGlustein deleted the efficient-expanding-window-calculations branch May 23, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Issues and PRs related to improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants