I removed the sleep batching to simplify the reasoning behind the execution path of the rate limiter.

I agree with you, though, regarding the perf implications. Sleep incurs a system call, and the cost of that is non-trivial over many requests. I'm curious to see how much sleep batching will save us in terms of performance.