Optimizing RangeList logic was, as expected, the most time-consuming operation today. At the end, the key was to modify the sorting algorithm for the underlying rbtree to use the center-point of a range for comparing, e.g. (begin+end)/2. Based on that, I was able to optimize all of the remaining RangeList operations to take logarithmic time instead of former linear time.
Based on the new RangeList, I quickly threw together IPFilter API, as described in previous blog post. Currently, it's capable of loading only mldonkey format ipfilter file, I ran into some odd problems with parsing/loading emule-styled ipfilter.dat right now - hoping to get those fixed tomorrow.
Speed testing (46306 ranges)
Load time: 0.46s (0.33s in optimized build)
isAllowed() method lookup time: estimated 0.00005s per call
100'000 calls take 0.24s (0.17s in optimized build)
Memory usage: 1720 kb for 46306 entries
Madcat, ZzZz