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

perf+fix: remove expensive table traversal for pending counts, fix buffer limiter #2282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ziinc
Copy link
Contributor

@Ziinc Ziinc commented Dec 13, 2024

This PR:

  • removes expensive table traversals in hot code paths, and instead uses table size as an estimate for the buffer pending length as it is O(1)
  • fixes buffer limiter to be based on the total size of the table as an estimate, which achieves the same intended goal of protecting memory, albeit being more conservative as it includes ingested events as well. However, theoretical total max queue size is currently num of cores * 50k so it would be plenty.

Also added benchmark to verify that list_pending_counts/1 was very expensive and should be avoided.

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.

1 participant