summaryrefslogtreecommitdiff
path: root/opendc/opendc-format/src
diff options
context:
space:
mode:
Diffstat (limited to 'opendc/opendc-format/src')
-rw-r--r--opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt11
1 files changed, 5 insertions, 6 deletions
diff --git a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt
index da678c07..2e2159ba 100644
--- a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt
+++ b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt
@@ -115,9 +115,9 @@ class Sc20TraceReader(
BufferedReader(FileReader(vmFile)).use { reader ->
reader.lineSequence()
- .chunked(1024)
+ .chunked(128)
.forEach { lines ->
- val res = ArrayList<FlopsHistoryFragment>(lines.size)
+ // val res = ArrayList<FlopsHistoryFragment>(lines.size)
for (line in lines) {
// Ignore comments in the trace
if (line.startsWith("#") || line.isBlank()) {
@@ -144,13 +144,12 @@ class Sc20TraceReader(
val fragment =
FlopsHistoryFragment(timestamp, flops, traceInterval, cpuUsage, cores)
if (last != null) {
- res.add(last!!)
+ yield(last!!)
}
fragment
}
}
-
- yieldAll(res)
+ // yieldAll(res)
}
if (last != null) {
@@ -172,7 +171,7 @@ class Sc20TraceReader(
uuid,
vmId,
mapOf(IMAGE_PERF_INTERFERENCE_MODEL to relevantPerformanceInterferenceModelItems),
- flopsFragments,
+ flopsFragments.asSequence(),
maxCores,
requiredMemory
)