liming30 commented on PR #20405:
URL: https://github.com/apache/flink/pull/20405#issuecomment-1202096355

   > @liming30 Thanks for your PR. Would you like to share some improvements if 
this PR merged via 
[flink-benchmarks](https://github.com/apache/flink-benchmarks).
   
   Hi, @fredia, I wrote the following benchmark on my local Mac and ran the JMH 
test. `deleteRange` is almost 10 times faster than `Iterator`.
   ```
      @Benchmark
       public void mapClear(KeyValue keyValue) throws Exception {
           keyedStateBackend.setCurrentKey(keyValue.setUpKey);
           mapState.clear();
       }
   ```
   
   Performance test results using `Iterator`:
   ```
   Benchmark                   (backendType)   Mode  Cnt     Score     Error   
Units
   MapStateBenchmark.mapClear        ROCKSDB  thrpt   30    13.165 ±   2.088  
ops/ms
   ```
   Performance test results using `deleteRange`:
   ```
   Benchmark                   (backendType)   Mode  Cnt     Score     Error   
Units
   MapStateBenchmark.mapClear        ROCKSDB  thrpt   30   121.860 ±  16.605  
ops/ms
   ```


-- 
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]

Reply via email to