From be176910eb870209576326ffaad8bf21241fccbd Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 Oct 2022 14:10:11 +0200 Subject: refactor(sim/core): Rename runBlockingSimulation to runSimulation This change renames the method `runBlockingSimulation` to `runSimulation` to put more emphasis on the simulation part of the method. The blocking part is not that important, but this behavior is still described in the method documentation. --- .../org/opendc/simulator/flow/FlowBenchmarks.kt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'opendc-simulator/opendc-simulator-flow/src/jmh') diff --git a/opendc-simulator/opendc-simulator-flow/src/jmh/kotlin/org/opendc/simulator/flow/FlowBenchmarks.kt b/opendc-simulator/opendc-simulator-flow/src/jmh/kotlin/org/opendc/simulator/flow/FlowBenchmarks.kt index e3cde1d2..86fbe8e4 100644 --- a/opendc-simulator/opendc-simulator-flow/src/jmh/kotlin/org/opendc/simulator/flow/FlowBenchmarks.kt +++ b/opendc-simulator/opendc-simulator-flow/src/jmh/kotlin/org/opendc/simulator/flow/FlowBenchmarks.kt @@ -27,7 +27,7 @@ import kotlinx.coroutines.launch import org.opendc.simulator.flow.mux.ForwardingFlowMultiplexer import org.opendc.simulator.flow.mux.MaxMinFlowMultiplexer import org.opendc.simulator.flow.source.TraceFlowSource -import org.opendc.simulator.kotlin.runBlockingSimulation +import org.opendc.simulator.kotlin.runSimulation import org.openjdk.jmh.annotations.* import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.TimeUnit @@ -49,27 +49,27 @@ class FlowBenchmarks { @Benchmark fun benchmarkSink() { - return runBlockingSimulation { + return runSimulation { val engine = FlowEngine(coroutineContext, clock) val provider = FlowSink(engine, 4200.0) - return@runBlockingSimulation provider.consume(TraceFlowSource(trace)) + return@runSimulation provider.consume(TraceFlowSource(trace)) } } @Benchmark fun benchmarkForward() { - return runBlockingSimulation { + return runSimulation { val engine = FlowEngine(coroutineContext, clock) val provider = FlowSink(engine, 4200.0) val forwarder = FlowForwarder(engine) provider.startConsumer(forwarder) - return@runBlockingSimulation forwarder.consume(TraceFlowSource(trace)) + return@runSimulation forwarder.consume(TraceFlowSource(trace)) } } @Benchmark fun benchmarkMuxMaxMinSingleSource() { - return runBlockingSimulation { + return runSimulation { val engine = FlowEngine(coroutineContext, clock) val switch = MaxMinFlowMultiplexer(engine) @@ -77,13 +77,13 @@ class FlowBenchmarks { FlowSink(engine, 3000.0).startConsumer(switch.newOutput()) val provider = switch.newInput() - return@runBlockingSimulation provider.consume(TraceFlowSource(trace)) + return@runSimulation provider.consume(TraceFlowSource(trace)) } } @Benchmark fun benchmarkMuxMaxMinTripleSource() { - return runBlockingSimulation { + return runSimulation { val engine = FlowEngine(coroutineContext, clock) val switch = MaxMinFlowMultiplexer(engine) @@ -101,7 +101,7 @@ class FlowBenchmarks { @Benchmark fun benchmarkMuxExclusiveSingleSource() { - return runBlockingSimulation { + return runSimulation { val engine = FlowEngine(coroutineContext, clock) val switch = ForwardingFlowMultiplexer(engine) @@ -109,13 +109,13 @@ class FlowBenchmarks { FlowSink(engine, 3000.0).startConsumer(switch.newOutput()) val provider = switch.newInput() - return@runBlockingSimulation provider.consume(TraceFlowSource(trace)) + return@runSimulation provider.consume(TraceFlowSource(trace)) } } @Benchmark fun benchmarkMuxExclusiveTripleSource() { - return runBlockingSimulation { + return runSimulation { val engine = FlowEngine(coroutineContext, clock) val switch = ForwardingFlowMultiplexer(engine) -- cgit v1.2.3