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

issues/235: Improve ratelimiter accuracy. #252

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

issues/235: Improve ratelimiter accuracy. #252

wants to merge 8 commits into from

Conversation

komuw
Copy link
Owner

@komuw komuw commented Mar 13, 2023

Why:

go test -timeout 7m -count=10 -run=XXXX -bench=BenchmarkRl github.com/komuw/ong/middleware > {old,new}.txt

benchstat old.txt new.tx

goos: linux
goarch: amd64
pkg: github.com/komuw/ong/middleware
cpu: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
│   old.txt   │              new.txt               │
│   sec/op    │   sec/op     vs base               │
Rl-8   40.01m ± 0%   43.05m ± 0%  +7.59% (p=0.000 n=10)

New impl is 7% slower. But it is more accurate.

komuw added 5 commits March 13, 2023 15:43
…/komuw/ong/middleware > {old,new}.txt

benchstat old.txt new.tx

goos: linux
goarch: amd64
pkg: github.com/komuw/ong/middleware
cpu: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
     │   old.txt   │              new.txt               │
     │   sec/op    │   sec/op     vs base               │
Rl-8   40.01m ± 0%   43.05m ± 0%  +7.59% (p=0.000 n=10)

New impl is 7% slower.
@komuw
Copy link
Owner Author

komuw commented Mar 13, 2023

flaky tests; https://github.com/komuw/ong/actions/runs/4387106426/jobs/7681993668

=== CONT  TestRl/success
    ratelimiter_test.go:156: 18 not within 4 of 14
--- FAIL: TestRl (0.00s)
    --- FAIL: TestRl/success (3.00s)

@komuw komuw changed the title Issues/235 c issues/235: Improve ratelimiter accuracy. Mar 13, 2023
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.

1 participant