rmuir commented on PR #12841: URL: https://github.com/apache/lucene/pull/12841#issuecomment-1840885611
> Thank you very much for your suggestions, i had fixed the comments from @jpountz, but the related to Mmapdir will be later(such as java19, java20 support), because we need to confirm whether to change it. i agree that we should be cautious here. in my understanding the optimized code is faster than the main branch probably because the optimized code doesn't need a `switch` statement in `GroupVIntUtil#readLongInGroup`, although it was inlined. > > The JMH output for currently, it's similar to before we replaced `varHander` with `ByteBuffer#getInt()` java17 > > ``` > Benchmark (size) Mode Cnt Score Error Units > GroupVIntBenchmark.byteBuffersReadGroupVInt 64 thrpt 5 4.698 ± 2.039 ops/us > GroupVIntBenchmark.byteBuffersReadGroupVIntBaseline 64 thrpt 5 2.167 ± 0.064 ops/us > GroupVIntBenchmark.mmap_byteBufferReadGroupVInt 64 thrpt 5 7.386 ± 0.524 ops/us > GroupVIntBenchmark.mmap_byteBufferReadGroupVIntBaseline 64 thrpt 5 7.358 ± 1.316 ops/us > GroupVIntBenchmark.nioReadGroupVInt 64 thrpt 5 8.236 ± 1.052 ops/us > GroupVIntBenchmark.nioReadGroupVIntBaseline 64 thrpt 5 5.381 ± 1.134 ops/us > ``` > > java21 > > ``` > Benchmark (size) Mode Cnt Score Error Units > GroupVIntBenchmark.byteBuffersReadGroupVInt 64 thrpt 5 4.622 ± 0.880 ops/us > GroupVIntBenchmark.byteBuffersReadGroupVIntBaseline 64 thrpt 5 1.674 ± 0.245 ops/us > GroupVIntBenchmark.mmap_byteBufferReadGroupVInt 64 thrpt 5 10.165 ± 1.083 ops/us > GroupVIntBenchmark.mmap_byteBufferReadGroupVIntBaseline 64 thrpt 5 5.104 ± 0.388 ops/us > GroupVIntBenchmark.nioReadGroupVInt 64 thrpt 5 9.527 ± 1.556 ops/us > GroupVIntBenchmark.nioReadGroupVIntBaseline 64 thrpt 5 5.351 ± 0.621 ops/us > ``` > > @uschindler Thank you for take a look at this, here is the assembly output for `MemorySegmentIndexInput#readGroupVInt`, using command: `java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly --module-path lucene/benchmark-jmh/build/benchmarks --module org.apache.lucene.benchmark.jmh GroupVIntBenchmark.mmap` > > assembly code you need to install hsdis to be able to see instructions and not just binary data from printassembly. see https://github.com/apache/lucene/blob/main/help/jmh.txt -- 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