Skip to content

Add JMH benchmarks comparing read I/O strategies under memory pressure#16279

Open
neoremind wants to merge 9 commits into
apache:mainfrom
neoremind:16044_readio_pr
Open

Add JMH benchmarks comparing read I/O strategies under memory pressure#16279
neoremind wants to merge 9 commits into
apache:mainfrom
neoremind:16044_readio_pr

Conversation

@neoremind

@neoremind neoremind commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Adds JMH benchmarks to compare read I/O strategies in memory constrained scenario, related to #16044.

I/O strategies tested:

  • mmap no madvise
  • mmap + MADV_NORMAL + MADV_WILLNEED
  • mmap + MADV_RANDOM
  • mmap + MADV_RANDOM + MADV_WILLNEED
  • FFI pread(2) via Panama
  • FileChannel + DirectByteBuffer (simulates NIOFSDirectory)
  • FileChannel + HeapByteBuffer
  • O_DIRECT

Thread counts: 1, 4, 8, 16.

How to run

dd if=/dev/urandom of=/path/to/pread-bench-16G.dat bs=1M count=16384

java -jar lucene/benchmark-jmh/build/benchmarks/lucene-benchmark-jmh-11.0.0-SNAPSHOT.jar RandomReadIOBenchmark \
  -jvmArgs "--enable-native-access=ALL-UNNAMED -Xms2g -Xmx2g -Dbench.file=/path/to/pread-bench-16G.dat -Dbench.fileSizeMB=16384" \
  -p readSize=16384 -p readsPerOp=16

@github-actions github-actions Bot added this to the 10.6.0 milestone Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants