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

Fixes for blocking limiter and perf improvements #154

Merged

Conversation

marcoferrer
Copy link
Contributor

I was writing a benchmark for the blocking limiter when I realized that it was susceptible to deadlocks.

This PR introduces the following changes

  • Mild refactor of BlockingLimiter and DeadlineLimiter
    • This reduces the number of goroutines needed to block down to 1
    • The blocking code now creates a timer and explicitly releases it when no longer needed so that it can be reclaimed without needing to elapse
    • Added a benchmark for blocking limiter
  • Reduce overhead of common metrics sampler in scenarios where the metrics registry is not supplied or noop.
  • Refactor SettableLimiter to reduce the number of mutex checks

Copy link
Owner

@platinummonkey platinummonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@platinummonkey platinummonkey merged commit be996e0 into platinummonkey:master May 13, 2024
3 checks passed
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.

None yet

2 participants