Skip to content

fix(bench): cache window sum instead of recomputing#2001

Merged
spetz merged 2 commits into
apache:masterfrom
blake-hu:fix-inefficient-moving-average-processor
Jul 15, 2025
Merged

fix(bench): cache window sum instead of recomputing#2001
spetz merged 2 commits into
apache:masterfrom
blake-hu:fix-inefficient-moving-average-processor

Conversation

@blake-hu
Copy link
Copy Markdown
Contributor

Closes #2000

Instead of recomputing sum of the moving window which would be O(n), we should instead just update the sum when a time point enters or leaves the moving window, which is O(1).

@spetz spetz merged commit cb26a8d into apache:master Jul 15, 2025
30 checks passed
T1B0 pushed a commit to T1B0/iggy that referenced this pull request Jul 16, 2025
Instead of recomputing sum of the moving window which would be O(n), we
should instead just update the sum when a time point enters or leaves
the moving window, which is O(1).
hageshiame pushed a commit to hageshiame/iggy that referenced this pull request Nov 7, 2025
Instead of recomputing sum of the moving window which would be O(n), we
should instead just update the sum when a time point enters or leaves
the moving window, which is O(1).
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.

Inefficient MovingAverageProcessor implementation

3 participants