lib/trees: improve bintrees efficiency

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)

Signed-off-by: Jean Privat <jean@pryen.org>
lib/std: Float has their own `==` and Comparable-related methods

Signed-off-by: Jean Privat <jean@pryen.org>
comp: fix shortcut-range (succ was removed)

Signed-off-by: Jean Privat <jean@pryen.org>
comp: shortcut-range work also on closed ranges

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update sav related to lines in kernel

Signed-off-by: Jean Privat <jean@pryen.org>
transform: do not transform rranges in for; this reactivates the short-range optimisation

Signed-off-by: Jean Privat <jean@pryen.org>
lib/std: add fast implementation for Array::==

Signed-off-by: Jean Privat <jean@pryen.org>
lib/std: add ArrayCmp to easily compare arrays of comparable elements.

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update because line changes in errors.

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: Reactivate shortcut range

Since transform.nit and the Numeric class (that renamed Discrete::succ into something else) the optimization that shortcut range was innefective.

After reactivating them, Perf increase is approx 5%.

Pull-Request: #657
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Merge: Improve Floats perfs

Improve perf for those who do not need excessive boxing of floats

Pull-Request: #656
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Merge: lib/trees: improve bintrees efficiency

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>
Merge: Compare arrays

Improve comparaisons in arrays

Pull-Request: #658
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>