timer: cache the minimal value.
We spend a lot of time searching for the next timer to expire: by caching
the minimum, we can skip most of this work. Even if timers are deleted,
the minimum will be a starting point for searching.
The expected-usage benchmark has to be increased by a factor of 100,
otherwise it's now too short.
Before:
$ ./expected-usage
1000000 in 12.701647935
After:
$ ./expected-usage 1000000
1000000 in 0.061095153
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Showing
Please register or sign in to comment