-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add an optional fast checker to (*partitionConsumer).responseFeeder #933
Conversation
Add a ticker in (*partitionConsumer).responseFeeder to frequently check for messages before starting the timeout timer. Using the fast checker significantly reduces the number of timer function calls when timeouts are infrequent.
Interesting PR, thanks for looking at performance here. Do you have any benchmarks or profiles showing the call to I'm also a bit concerned by the complexity of the implementation here. Have you considered just converting the |
We considered converting the |
Ya, I think that would be fine as long as we're clear about it in the documentation. The implementation will definitely be a lot easier to follow. |
To clarify a little further: the timer is already very inaccurate because of the way it interacts with the buffer size of the Given this, I would be OK with just switching to the fast-checker and not adding a configuration option. Thoughts? |
That makes sense. The configuration option was just left in because this change would technically change the timeout behavior (even though it is already very inaccurate as you described). I'll go ahead and make that change. |
e964019
to
9112d76
Compare
Thanks! |
Add a ticker in (*partitionConsumer).responseFeeder to frequently check for
messages before starting the timeout timer. Using the fast checker significantly
reduces the number of timer function calls when timeouts are infrequent.