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

Cloudflare: perf improvement #43

Merged
merged 4 commits into from Jan 23, 2024
Merged

Cloudflare: perf improvement #43

merged 4 commits into from Jan 23, 2024

Conversation

yosiat
Copy link
Contributor

@yosiat yosiat commented Jan 23, 2024

  • Benchmarks: give more runs, for better comparisons
  • Limiter benchmarks: run against real redis server in order to reduce noise
  • Cloudflare: reduce allocs

```
name                        old time/op    new time/op    delta
_CloudflareAlgorithm-10       30.2µs ± 8%    30.1µs ± 8%     ~     (p=1.000 n=5+5)
_GcraAlgorithm-10             34.3µs ± 2%    34.7µs ± 2%     ~     (p=0.421 n=5+5)
_SlidingWindowAlgorithm-10    35.8µs ± 1%    37.7µs ± 5%   +5.42%  (p=0.016 n=5+5)

name                        old alloc/op   new alloc/op   delta
_CloudflareAlgorithm-10       1.45kB ± 0%    1.36kB ± 0%   -6.24%  (p=0.008 n=5+5)
_GcraAlgorithm-10               806B ± 0%      806B ± 0%     ~     (all equal)
_SlidingWindowAlgorithm-10      616B ± 0%      616B ± 0%     ~     (all equal)

name                        old allocs/op  new allocs/op  delta
_CloudflareAlgorithm-10         43.0 ± 0%      37.0 ± 0%  -13.95%  (p=0.008 n=5+5)
_GcraAlgorithm-10               22.0 ± 0%      22.0 ± 0%     ~     (all equal)
_SlidingWindowAlgorithm-10      17.0 ± 0%      17.0 ± 0%     ~     (all equal)
```
```
name                        old time/op    new time/op    delta
_CloudflareAlgorithm-10       30.1µs ± 8%    30.2µs ± 6%    ~     (p=1.000 n=5+5)

name                        old alloc/op   new alloc/op   delta
_CloudflareAlgorithm-10       1.36kB ± 0%    1.35kB ± 1%  -0.78%  (p=0.016 n=5+5)

name                        old allocs/op  new allocs/op  delta
_CloudflareAlgorithm-10         37.0 ± 0%      37.0 ± 0%    ~     (all equal)
```
@yosiat yosiat requested a review from a team as a code owner January 23, 2024 16:29
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9c3bf22) 73.52% compared to head (5057eb8) 73.52%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #43   +/-   ##
=======================================
  Coverage   73.52%   73.52%           
=======================================
  Files           2        2           
  Lines          34       34           
=======================================
  Hits           25       25           
  Misses          7        7           
  Partials        2        2           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d48ac45...5057eb8. Read the comment docs.

@yosiat yosiat merged commit 36d86bf into master Jan 23, 2024
3 checks passed
@yosiat yosiat deleted the perf branch January 23, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants