We now use a simple LL because there are usually no more than 100 or timers we need to check every few ms, and that's not a real concern, but this is far from optimal.
We should instead use either a hierarchical timerwheel or a simple heap/priority queue. Turns out go's using heaps, and O(1) for accessing the next timer to fire is a very desire properly, and given that all other operations cost O(log(n)) (no more than 14 ops for 10k timers), it makes a lot of sense to use binary heaps.
We now use a simple LL because there are usually no more than 100 or timers we need to check every few ms, and that's not a real concern, but this is far from optimal.
We should instead use either a hierarchical timerwheel or a simple heap/priority queue. Turns out go's using heaps, and O(1) for accessing the next timer to fire is a very desire properly, and given that all other operations cost O(log(n)) (no more than 14 ops for 10k timers), it makes a lot of sense to use binary heaps.