[ 
https://issues.apache.org/jira/browse/FLINK-24967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17447515#comment-17447515
 ] 

Piotr Nowojski commented on FLINK-24967:
----------------------------------------

[~aitozi], about this TODO that I've left, I didn't mean it to be fully 
parametrisable. They should be however moved to a context class like for 
example {{DataSkewStreamNetworkThroughputBenchmarkExecutor.MultiEnvironment}}. 
Note that contexts can have different scopes.

With the current setup there are a couple of issues.
# It's generally speaking difficult to work with static fields and especially 
the not so pretty static initialisation segments. 
# JVM theoretically could pick up such static field as a constant, and optimise 
the code to something that would be far far away from out intention, via loop 
unrolling constant folding, dead code elimination. For example if JVM notices 
that result of a method is not used anywhere and that the code doesn't have 
side effects, it can remove all of that code for being "a dead code". JMH as 
far as I remember has mechanism to prevent that from happening, but for this to 
work all of the input parameters to the benchmark should be passed via that 
context classes or via {{@Params}}. 
# Partially related to my TODO comments from {{StateBenchmarkBase}} is that 
some of those "static" variables and 
{{org.apache.flink.state.benchmark.StateBenchmarkBase.KeyValue#kvSetup}} 
initialisation code are only used in some benchmarks - not in all of them. As 
such there is no point in executing them per every benchmark. For example 
initialisation of 
{{org.apache.flink.state.benchmark.StateBenchmarkBase.KeyValue#listValue}} is 
quite costly, but it is only being used in two benchmarks out of ~20. With 
contexts classes it would be easy/easier to initialise/setup only those things 
that we really need to.

> Make the IO pattern configureable in state benchmarks
> -----------------------------------------------------
>
>                 Key: FLINK-24967
>                 URL: https://issues.apache.org/jira/browse/FLINK-24967
>             Project: Flink
>          Issue Type: Improvement
>          Components: Benchmarks, Runtime / State Backends
>            Reporter: Aitozi
>            Priority: Minor
>
> Currently, state benchmarks IO size are controlled by 
> {{StateBenchmarkConstants}}, which are not flexible to change. It's not easy 
> to test the performance under different IO size/pattern and different disk 
> (which can be solved by 
> [FLINK-24918|https://issues.apache.org/jira/browse/FLINK-24918]). I purpose 
> to make the state benchmark more configurable .



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to