Closed mpilquist closed 1 year ago
Based on what I can find, this is definitely something that is worth doing. If we can get it in for 3.0, it would be ideal, but it's technically something that can land afterward if necessary.
This looks fun! Happy to have a stab at it at least
I think this is really needed. I was fired an issue https://github.com/reactor/reactor-core/issues/2965 and switch to Akka just because of this.
@He-Pin see the following discussions regarding plans for 3.5.0:
Not a hashwheel timer, but still a replacement for ScheduledExecutorService
.
@armanbilge @djspiewak I think this need renmaed to add a HashedWheelTimer to cats-effect
because the current integrated timer is O(log N), not O(1)
Netty, Akka, Blaze, and other libraries all use a variant of a hash wheel timer for scheduling lots of non-blocking tasks:
https://stackoverflow.com/questions/17276393/hashedwheeltimer-vs-scheduledthreadpoolexecutor-for-higher-performance
We should consider adopting something similar for CE3, measured against ScheduledExecutorService to see which is better. At the very least, we should ensure there are no API changes necessary if we later want to swap in a custom scheduler.