-
Notifications
You must be signed in to change notification settings - Fork 22
feat: implemented using lua #49
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
Conversation
|
Hi there, any plans to merge this? I was thinking about writing my own rate limiter with inlined Lua, much like you just did here. Your solution seems as simple as I was looking to make mine, so I would love to have this in a released version! |
|
Thanks for remembering me to ship this @dy0gu 🙂 I added a benchmark, and it seems the lua implementation is much faster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (1)
src/index.js:22
- If microtime.now() returns a timestamp in microseconds, multiplying duration (in seconds) by 1000 may yield incorrect time differences when later dividing by 1000000. Consider using duration * 1000000 to ensure unit consistency.
local start = now - duration * 1000
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- package.json: Language not supported

Sorry for that, but perf matters. Holding this until add a benchmark
before
**after **