jpountz commented on code in PR #13989: URL: https://github.com/apache/lucene/pull/13989#discussion_r1839685981
########## lucene/core/src/java/org/apache/lucene/store/BufferedChecksum.java: ########## @@ -60,6 +64,37 @@ public void update(byte[] b, int off, int len) { } } + void updateShort(short val) { + if (upto + Short.BYTES > buffer.length) flush(); + BitUtil.VH_LE_SHORT.set(buffer, upto, val); + upto += Short.BYTES; + } + + void updateInt(int val) { + if (upto + Integer.BYTES > buffer.length) flush(); + BitUtil.VH_LE_INT.set(buffer, upto, val); + upto += Integer.BYTES; + } + + void updateLong(long val) { + if (upto + Long.BYTES > buffer.length) flush(); + BitUtil.VH_LE_LONG.set(buffer, upto, val); + upto += Long.BYTES; + } + + void updateLongs(long[] vals, int offset, int len) { + flush(); Review Comment: All other `updateXXX()` methods only flush if there is no room left or if the data to update is bigger than the buffer size. I'd like to retain this property here (even though your benchmarks suggest that it doesn't hurt performance much). -- 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 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