Myasuka commented on pull request #15119:
URL: https://github.com/apache/flink/pull/15119#issuecomment-810806328


   @StephanEwen , thanks for your suggestions. My first PR chose to use less 
lambdas but then I refactored my implementation to choose better abstraction to 
avoid code duplication in next reviews. However, I should think of more about 
performance instead of clean code here.
   I have verified it quickly with [draft 
commit](https://github.com/Myasuka/flink/commit/ebc88594e41fdd15fe60c1fe4c0f08fc85907fdc)
 and see the performance behaves better on heap state backend map related 
operations:
   
   
   Benchmark | backendType | current PR  implementation | less lambdas and 
hashmap lookup | performance changes
   -- | -- | -- | -- | --
   MapStateBenchmark.mapAdd | HEAP | 4295.446 | 4402.606 | 2.49%
   MapStateBenchmark.mapContains | HEAP | 3609.574 | 3661.509 | 1.44%
   MapStateBenchmark.mapEntries | HEAP | 12270.087 | 18040.646 | 47.03%
   MapStateBenchmark.mapGet | HEAP | 3483.249 | 3495.29 | 0.35%
   MapStateBenchmark.mapIsEmpty | HEAP | 4887.583 | 4927.959 | 0.83%
   MapStateBenchmark.mapIterator | HEAP | 12807.682 | 18896.097 | 47.54%
   MapStateBenchmark.mapKeys | HEAP | 13020.899 | 20141.958 | 54.69%
   MapStateBenchmark.mapPutAll | HEAP | 2216.094 | 2413.75 | 8.92%
   MapStateBenchmark.mapRemove | HEAP | 4132.611 | 4692.476 | 13.55%
   MapStateBenchmark.mapUpdate | HEAP | 3440.258 | 3522.312 | 2.39%
   MapStateBenchmark.mapValues | HEAP | 12207.236 | 19732.517 | 61.65%
   
    Those iterator-like operations have obvious performance gain. I'll change 
current PR to less lambdas and hashmap lookup. 


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to