mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-11 09:04:21 +01:00
Our uintmap can be a little slow with all the reallocation, so leave NULL entries and walk to find the first one. Since we don't clean them up, keep a cache of where the min non-all-NULL value is in the heap. It's clearer benefit on really large tests, so here's 1M nodes: Comparison using gossipd/test/run-bench-find_route 1000000 10: Before: 10 (10 succeeded) routes in 1000000 nodes in 91995 msec (9199532898 nanoseconds per route) After: 10 (10 succeeded) routes in 1000000 nodes in 20605 msec (2060539287 nanoseconds per route) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>