From 6efadf44d0ca34505e024a90bf6e8c169d36402e Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 13 Dec 2016 10:53:13 -0500 Subject: [PATCH] stepcompress: Favor higher add values when bisecting Instead of splitting the available "add range" in half, try for add values closer to the higher end of the range. This heuristic seems to result in better choices. Signed-off-by: Kevin O'Connor --- klippy/stepcompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klippy/stepcompress.c b/klippy/stepcompress.c index eb9abf2c..0ae3bd57 100644 --- a/klippy/stepcompress.c +++ b/klippy/stepcompress.c @@ -202,7 +202,7 @@ compress_bisect_add(struct stepcompress *sc) // Bisect valid add range and try again with new 'add' if (minadd > maxadd) break; - add = (minadd + maxadd) / 2; + add = maxadd - (maxadd - minadd) / 4; } return (struct step_move){ bestinterval, bestcount, bestadd }; }