go-chi / chi

Optimize throttle middleware by avoiding unnecessary timer creation (#1011)
- Only create time.NewTimer() when actually needed to wait - Reduces allocations from 7 to 4 and memory usage by ~54% - Improves performance by ~50% in high-throughput scenarios
Vasily Tsybenko Vasily Tsybenko committed on Aug 26, 2025, 11:23 AM
Showing 2 changed files +30 additions -2 deletions
Browse files at this commit โ†’