This patch teaches the Binning correction type to detect whether the specified binning is uniform or not. If it is, at evaluation time the is found via a simple arithmetic operation rather than via binary search.
For now I have not written new tests because the existing cases in test_core.py already cover uniform as well as non-uniform binning. I can add ad-hoc tests if necessary.
I have not run any benchmarks yet: I wanted to see first whether the design is green-lit first :smile: This design introduces an extra branch ("is binning uniform?") inside Binning::child, which runs in the hot loop. The only way I can think of removing the branch, however, is to introduce one extra correction type, UniformBinning -- which would require a much larger patch. Not sure if worth it?
This patch teaches the Binning correction type to detect whether the specified binning is uniform or not. If it is, at evaluation time the is found via a simple arithmetic operation rather than via binary search.
For now I have not written new tests because the existing cases in
test_core.py
already cover uniform as well as non-uniform binning. I can add ad-hoc tests if necessary.I have not run any benchmarks yet: I wanted to see first whether the design is green-lit first :smile: This design introduces an extra branch ("is binning uniform?") inside
Binning::child
, which runs in the hot loop. The only way I can think of removing the branch, however, is to introduce one extra correction type,UniformBinning
-- which would require a much larger patch. Not sure if worth it?