https://bugs.openldap.org/show_bug.cgi?id=10526
--- Comment #9 from Howard Chu hyc@openldap.org --- Created attachment 1161 --> https://bugs.openldap.org/attachment.cgi?id=1161&action=edit Benchmark original vs binary search
Using your test as a starting point. This program first just generates the data 200000 times, to get a baseline cost of data generation. Only the case of two lists is being timed.
Then it times both the mdb_idl_intersection_orig and the mdb_idl_intersection_fixed. The _fixed version, using binary search, is slower.
You can also specify the number of iterations and seed as arguments, if desired.