mikemccand 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_r347415612
########## File path: lucene/core/src/java/org/apache/lucene/store/ByteBufferIndexInput.java ########## @@ -107,6 +117,40 @@ public final void readBytes(byte[] b, int offset, int len) throws IOException { } } + @Override + public void readLELongs(long[] dst, int offset, int length) throws IOException { + // ByteBuffer#getLong could work but it has some per-long overhead and there + // is no ByteBuffer#getLongs to read multiple longs at once. So we use the + // below trick in order to be able to leverage LongBuffer#get(long[]) to + // read multiple longs at once with as little overhead as possible. + if (curLongBufferViews == null) { + // readLELongs is only used for postings today, so we compute the long + // views lazily so that other data-structures don't have to pay for the + // associated initialization/memory overhead. + curLongBufferViews = new LongBuffer[Long.BYTES]; Review comment: Thanks! ---------------------------------------------------------------- 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