Skip to content

Commit 0dd0b6b

Browse files
committed
Adjust benchmark output to be exactly what is expected by the graph drawing code
1 parent fae797e commit 0dd0b6b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/kotlin/be/ugent/topl/mio/debugger/Debugger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ open class Debugger(private val connection: Connection, start: Boolean = true, p
434434
class AtEveryInstruction() : SnapshotPolicy(1) {
435435
override fun toString() = "Snapshot at every instruction"
436436
}
437-
data class Checkpointing(private val interval: Int = 20) : SnapshotPolicy(2) {
437+
data class Checkpointing(val interval: Int = 20) : SnapshotPolicy(2) {
438438
override fun serialize(): String {
439439
return super.serialize() + HexaEncoder.serializeUInt32BE(interval)
440440
}

src/test/kotlin/benchmarks/Benchmarks.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Benchmarks : DebuggerTestBase() {
2323
@Test
2424
fun `Measure impact of checkpointing on forward execution`() {
2525
val writer = FileWriter(File("results-forward-execution.csv"))
26-
writer.write("Policy, Instructions executed, Time elapsed\n")
26+
writer.write("Interval,Instructions executed,Time(ms)\n")
2727
val results = mutableListOf<Triple<Int, Double, Debugger.SnapshotPolicy>>()
2828
for (policy in listOf(
2929
Debugger.SnapshotPolicy.None(),
@@ -45,7 +45,7 @@ class Benchmarks : DebuggerTestBase() {
4545
totalTime += currentTimeMillis() - startTime
4646
}
4747
}
48-
writer.write("$policy, $n, ${totalTime.toDouble() / times}\n")
48+
writer.write("${if(policy is Debugger.SnapshotPolicy.Checkpointing) policy.interval else 0}, $n, ${totalTime.toDouble() / times}\n")
4949
writer.flush()
5050
}
5151
}

0 commit comments

Comments
 (0)