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(gateway): reuse ratelimiter's cleanup instant #2212

Merged
merged 4 commits into from
Jun 25, 2023

Conversation

vilgotf
Copy link
Member

@vilgotf vilgotf commented May 21, 2023

Short and simple micro-optimization that removes a syscall from CommandRatelimiter::poll_ready + some minor cleanup.

The pruning of elapsed permits after the sleep timer's elapsed requires
the current time, however, this involves a syscall, so let's reuse it.
Let's do the calculation for the user & move it to DEBUG as it's now
human readable.
@github-actions github-actions bot added c-gateway Affects the gateway crate t-perf Improves performace labels May 21, 2023
@vilgotf vilgotf force-pushed the vilgotf/gateway/perf/ratelimiter branch from a81e7a2 to 875b665 Compare May 21, 2023 16:11
@vilgotf vilgotf marked this pull request as draft May 21, 2023 19:20
Copy link
Member

@Gelbpunkt Gelbpunkt left a comment

Choose a reason for hiding this comment

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

Looks good

@vilgotf vilgotf force-pushed the vilgotf/gateway/perf/ratelimiter branch from 9518b85 to 6166c87 Compare June 22, 2023 13:24
@vilgotf vilgotf marked this pull request as ready for review June 22, 2023 13:28
@vilgotf vilgotf requested a review from Gelbpunkt June 25, 2023 12:38
@vilgotf vilgotf merged commit d4145c8 into main Jun 25, 2023
@vilgotf vilgotf deleted the vilgotf/gateway/perf/ratelimiter branch June 25, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-gateway Affects the gateway crate t-perf Improves performace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants