Savonitar opened a new pull request, #127: URL: https://github.com/apache/flink-benchmarks/pull/127
## Purpose of the change The existing RocksDB `MapState` benchmarks measure the cost of bounding an iterator when reading live entries. After many deletions, a bound can also save work: a read of an empty map or timer key group can stop before scanning deletion markers belonging to the next one. This PR adds two benchmarks for that workload. [FLINK-41519](https://issues.apache.org/jira/browse/FLINK-41519) ยท [FLINK-40584](https://issues.apache.org/jira/browse/FLINK-40584) ## Brief change log - `RocksdbClearedMapStateBenchmark` populates 20,000 maps with 10 entries each, clears them, and measures `MapState.isEmpty()`. A fixed-seed shuffle samples keys at different scan distances during each iteration. - `RocksdbTimerServiceInitBenchmark` fires 100,000 event-time timers and takes an incremental checkpoint. Each invocation restores the checkpoint before timing `open()`, which initializes the RocksDB timer service. The benchmark runs with 128 and 4,096 key groups. ## Verifying this change The project compiled on JDK 17 and passed Spotless and Checkstyle. RocksDB counters confirmed that the map fixture held 200,000 deletion markers in its active memtable with zero SST files. At both key-group settings, the restored timer fixture had one SST file containing all 100,000 deletion markers and zero live timers. Example results from commit `c533b01` on macOS arm64, Amazon Corretto 17.0.13, Flink 2.5-SNAPSHOT, and JMH 1.37. Each score is the mean of three one-second measurement iterations after one one-second warmup, using one thread and one fork. | Benchmark | Key groups | Score | | --- | ---: | ---: | | `clearedMapIsEmpty` | | 777.1 ops/ms | | `timerServiceInit` | 128 | 11.46 ms/op | | `timerServiceInit` | 4,096 | 20.78 ms/op | To reproduce with the packaged benchmark JAR: ```sh java -Xmx1g --add-opens java.base/java.util=ALL-UNNAMED \ -jar target/benchmarks.jar 'Rocksdb(ClearedMapState|TimerServiceInit)Benchmark' \ -t 1 -f 1 -wi 1 -w 1s -i 3 -r 1s ``` ## Impact and documentation The two new JMH results can be tracked across Flink revisions. The benchmark Javadocs describe where the deletion markers reside and which part of each operation is timed. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes Generated-by: Claude Code (Fable 5.2) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
