jpountz commented on a change in pull request #973: LUCENE-9027: Use SIMD instructions to decode postings. URL: https://github.com/apache/lucene-solr/pull/973#discussion_r347371932
########## File path: lucene/core/src/java/org/apache/lucene/store/ByteBufferIndexInput.java ########## @@ -107,6 +118,28 @@ public final void readBytes(byte[] b, int offset, int len) throws IOException { } } + @Override + public void readLELongs(long[] dst, int offset, int length) throws IOException { + if (curLongBufferViews == null) { + // Lazy init to not make pay for memory and initialization cost if you don't need to read arrays of longs Review comment: > under the hood the CPU must still do unaligned long decodes (which I think modern X86-64 are good at)? Maybe add a comment about why this trick is worthwhile? This is mostly a workaround for the lack of ByteBuffer#getLongs(long[]). Avoiding the LongBuffer view would require to call ByteBuffer#getLong in a loop, which seems to have some per-long overhead according to the microbenchmarks I ran. I'll leave a comment. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org