summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-flow/src/jmh
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-05 14:10:11 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-05 14:10:11 +0200
commitbe176910eb870209576326ffaad8bf21241fccbd (patch)
tree3903d8aed5e87850c92e1b2dce8379ea99bdfa6d /opendc-simulator/opendc-simulator-flow/src/jmh
parentc214a7fe0d46ecc23a71f9237b20281c0ca1c929 (diff)
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.
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow/src/jmh')
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/jmh/kotlin/org/opendc/simulator/flow/FlowBenchmarks.kt22
1 files changed, 11 insertions, 11 deletions
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)