mikemccand opened a new issue, #12379: URL: https://github.com/apache/lucene/issues/12379
### Description Spinoff from https://github.com/apache/lucene/pull/12377. I noticed this loop in `DirectMonotonicWriter` that is computing the error signal of a simple "linear fit" model, for better compression of monotonically increasing `long` values: ``` final float avgInc = (float) ((double) (buffer[bufferSize - 1] - buffer[0]) / Math.max(1, bufferSize - 1)); for (int i = 0; i < bufferSize; ++i) { final long expected = (long) (avgInc * (long) i); buffer[i] -= expected; } ``` We are truncating the predicted value to the nearest `long`, but wouldn't it maybe be a bit better compression if we `Math.round`'d instead? The abs(error) might sometimes be lower by 1? I'm not sure, it's hard to think about! The problem / challenge is backwards compatibility ... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org