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

refactor(gateway): reuse 'now' instant for poll_acquire #2393

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

vilgotf
Copy link
Member

@vilgotf vilgotf commented Dec 1, 2024

We're always calling clock_gettime() when acquiring a permit even if we've just done so already in when checking readiness. This is not a big deal performance wise, but it feels counterintuitive to not reuse already fetched resources as if the alrorithm required it (it does not).

@vilgotf vilgotf added c-gateway Affects the gateway crate t-refactor Refactors APIs or code. labels Dec 1, 2024
@vilgotf vilgotf merged commit 2099918 into main Dec 7, 2024
9 checks passed
@vilgotf vilgotf deleted the vilgotf/gateway-ratelimiterp1 branch December 7, 2024 07:36
viztea pushed a commit to eara-bot/twilight that referenced this pull request Feb 15, 2025
…s#2393)

We're always calling `clock_gettime()` when acquiring a permit even if
we've just done so already in when checking readiness. This is not a big
deal performance wise, but it feels counterintuitive to not reuse
already fetched resources as if the alrorithm required it (it does not).
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-refactor Refactors APIs or code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants