My followup just created a FOR_ALL_INTERFACES_UP macro which led to even less code. :)
Elsewhere I've been dithering. The proof of concept for uthash in resend, was quite satisfying but far too much unneeded overhead (56 bytes per entry on 64 bits!! + the malloc overhead!), so I have been looking over khash and so forth ( https://github.com/attractivechaos/klib ) the benchmarks were impressive, but like all benchmarks, flawed - testing an integer hash, where we need 34 bytes of "some hash" (jenkins? spooky?), and x86 only, where I care mostly about mips, and I care about startup time for a hash a lot....- I figure reworking those benchmarks to (say) import a BGP route table, and then try to project how much SADR and p2p routes are used, and a real lookup/insert ratio in a benchmark would be more useful. But I get 14MOPs/sec on the basic benchmark on my x86 box on a million integers... lookups take 10ns.... Babel has an ordered "slot" concept in it... Elsewhere I was poking into the the evolution of the kernel's timerwheel thing ( https://lwn.net/Articles/646950/ ) which makes the valid point that most babel "timeouts" are really recurring events.... And elsewhere, elsewhere, figured out how to switch to 64bit time. In glibc (not musl so far as I know) the clock_getttime lookup is incredibly fast because it just maps in the relevant kernel page and does the work without a syscall, and dealing with a straight 64 bit quantity would always be a win on 64 bit platforms and probably a win even on 32 bit ones. #if __APPLE__ #include <mach/mach_time.h> static mach_timebase_info_data_t timebase; #endif static s64 monotime(void) { #if __APPLE__ unsigned long long abt; abt = mach_absolute_time(); abt = abt * timebase.numer / timebase.denom; return abt / 1000LL; #else struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return (ts.tv_sec * 1000000L) + (ts.tv_nsec / 1000L); #endif } /* monotime() */ _______________________________________________ Babel-users mailing list Babel-users@alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/babel-users