easyice commented on PR #12841: URL: https://github.com/apache/lucene/pull/12841#issuecomment-1869575788
There seems to be a speedup on [prefix queries](http://people.apache.org/~mikemccand/lucenebench/Prefix3.html) in nightly benchmarks. For reference, here is the benchmark in branch_9x with this PR, the performance of `ByteBuffersIndexInput` looks better than java17, `NIOFSDirectoryInputs` is similar than java17, but `MMapDirectoryInputs` has performance regression( we don't change the MMapDirectory impl) java11: ``` Benchmark (size) Mode Cnt Score Error Units GroupVIntBenchmark.benchByteBuffersIndexInput_readGroupVInt 64 thrpt 5 5.064 ± 0.069 ops/us GroupVIntBenchmark.benchByteBuffersIndexInput_readGroupVIntBaseline 64 thrpt 5 1.612 ± 0.078 ops/us GroupVIntBenchmark.benchMMapDirectoryInputs_readGroupVInt 64 thrpt 5 6.334 ± 0.914 ops/us GroupVIntBenchmark.benchMMapDirectoryInputs_readGroupVIntBaseline 64 thrpt 5 7.362 ± 0.505 ops/us GroupVIntBenchmark.benchMMapDirectoryInputs_readVInt 64 thrpt 5 4.885 ± 0.545 ops/us GroupVIntBenchmark.benchNIOFSDirectoryInputs_readGroupVInt 64 thrpt 5 2.977 ± 0.346 ops/us GroupVIntBenchmark.benchNIOFSDirectoryInputs_readGroupVIntBaseline 64 thrpt 5 2.660 ± 1.700 ops/us ``` I ran with `-XX:+PrintInlining` parameter in `benchMMapDirectoryInputs_readGroupVInt` task, the output is similar to java17 ``` 702 799 3 org.apache.lucene.store.DataInput::readGroupVInts (41 bytes) made not entrant @ 12 org.apache.lucene.store.DataInput::readGroupVInt (7 bytes) inline (hot) \-> TypeProfile (26795/26795 counts) = org/apache/lucene/store/ByteBufferIndexInput$SingleBufferImpl @ 3 org.apache.lucene.util.GroupVIntUtil::readGroupVInt (77 bytes) inline (hot) ! @ 1 org.apache.lucene.store.ByteBufferIndexInput::readByte (100 bytes) inline (hot) @ 8 org.apache.lucene.store.ByteBufferGuard::getByte (9 bytes) inline (hot) @ 1 org.apache.lucene.store.ByteBufferGuard::ensureValid (16 bytes) inline (hot) ! @ 5 java.nio.DirectByteBuffer::get (28 bytes) inline (hot) \-> TypeProfile (13760/13760 counts) = java/nio/DirectByteBufferR @ 5 java.nio.Buffer::nextGetIndex (31 bytes) inline (hot) @ 8 java.nio.DirectByteBuffer::ix (10 bytes) inline (hot) @ 11 jdk.internal.misc.Unsafe::getByte (7 bytes) force inline by annotation @ 3 jdk.internal.misc.Unsafe::getByte (0 bytes) (intrinsic) @ 16 java.lang.ref.Reference::reachabilityFence (1 bytes) force inline by annotation @ 39 org.apache.lucene.util.GroupVIntUtil::readLongInGroup (81 bytes) inline (hot) ! @ 49 org.apache.lucene.store.ByteBufferIndexInput::readShort (25 bytes) inline (hot) @ 8 org.apache.lucene.store.ByteBufferGuard::getShort (9 bytes) inline (hot) @ 1 org.apache.lucene.store.ByteBufferGuard::ensureValid (16 bytes) inline (hot) ! @ 5 java.nio.DirectByteBuffer::getShort (27 bytes) inline (hot) \-> TypeProfile (59062/59062 counts) = java/nio/DirectByteBufferR @ 4 java.nio.Buffer::nextGetIndex (38 bytes) inline (hot) @ 7 java.nio.DirectByteBuffer::ix (10 bytes) inline (hot) ! @ 10 java.nio.DirectByteBuffer::getShort (32 bytes) inline (hot) @ 9 jdk.internal.misc.Unsafe::getShortUnaligned (12 bytes) inline (hot) @ 5 jdk.internal.misc.Unsafe::getShortUnaligned (33 bytes) (intrinsic) @ 8 jdk.internal.misc.Unsafe::convEndian (16 bytes) inline (hot) @ 17 java.lang.ref.Reference::reachabilityFence (1 bytes) force inline by annotation @ 15 java.lang.ref.Reference::reachabilityFence (1 bytes) force inline by annotation ``` -- 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