intmap: add iterator-by-callback.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 26 Mar 2018 10:42:39 +0000 (21:12 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 26 Mar 2018 10:42:39 +0000 (21:12 +1030)
commit1e888a93a79132f28f59319558187278badbe418
tree21d911f58aa4e612395a06e8ec0eaf632522fe28
parenta241664cddd9c1a9a66064171f871ae52598b82b
intmap: add iterator-by-callback.

It's significantly faster because it assumes no deletion:

10000000,critbit iteration (nsec),316
10000000,critbit callback iteration (nsec),90
...
10000000,critbit consecutive iteration (nsec),308
10000000,critbit consecutive callback iteration (nsec),78

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/intmap/benchmark/speed.c
ccan/intmap/intmap.c
ccan/intmap/intmap.h
ccan/intmap/test/run-order.c