no.email at nospam.invalid
Tue Jan 20 19:14:47 CET 2015
Marko Rauhamaa <marko at pacujo.net> writes:
> As I said, I use ordered mappings to implement timers... The downside
> of heapq is that canceled timers often flood the heapq structure...,
> GvR mentioned a periodic "garbage collection" as a potentially
> effective solution.
You could look up the "timer wheel" approach used by the Linux kernel
and by Erlang. It's less general than an ordered map, but probably
faster in practice.
Has some info. I think the kernel uses a different method now though.
Fwiw, I believe that the Haskell i/o manager uses an ordered map, and it
gets monstrous performance:
More information about the Python-list