Merge: lib/trees: improve bintrees efficiency
authorJean Privat <jean@pryen.org>
Fri, 8 Aug 2014 17:30:31 +0000 (13:30 -0400)
committerJean Privat <jean@pryen.org>
Fri, 8 Aug 2014 17:30:31 +0000 (13:30 -0400)
First, comment potential slow asserts in the hot-path.
These asserts are needed only to check that the implementation is
correct.

Second, use a single `<=>` instead of doing multiple comparisons.
So reduce the total number of comparisons.

On a real instance (IA-related problems), the gain is the following:

RBTreeMap, 8738 insertions, 24855 accesses
Before: 2.54s
After: 0.07s (so, in the noise)

Pull-Request: #653
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>


Trivial merge