Skip to content

Commit bdc5c82

Browse files
Elena LepilkinaElena Lepilkina
authored andcommitted
Review fixes
1 parent fb644ce commit bdc5c82

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

examples/kotlin-multiplatform/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ benchmark {
9494
fast { // --> jvmFastBenchmark
9595
include("Common")
9696
exclude("long")
97-
iterations = 10
97+
iterations = 5
9898
iterationTime = 300 // time in ms per iteration
9999
iterationTimeUnit = "ms" // time in ms per iteration
100100
advanced("forks", 1)

plugin/main/src/kotlinx/benchmark/gradle/NativeMultiplatformTasks.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fun Project.createNativeBenchmarkExecTask(
116116
onlyIf { linkTask.enabled }
117117

118118
val reportsDir = benchmarkReportsDir(config, target)
119-
reportFile = reportsDir.resolve("${target.name}.json")
119+
reportFile = reportsDir.resolve("${target.name}.${config.reportFileExt()}")
120120

121121
val executableFile = linkTask.outputFile.get()
122122
executable = executableFile.absolutePath
@@ -175,7 +175,6 @@ open class NativeBenchmarkExec() : DefaultTask() {
175175
// Get full list of running benchmarks
176176
execute(listOf(configFile.absolutePath, "--list", benchsDescriptionDir.absolutePath))
177177
val detailedConfigFiles = project.fileTree(benchsDescriptionDir).files.sortedBy { it.absolutePath }
178-
val jsonReportParts = mutableListOf<File>()
179178
val runResults = mutableMapOf<String, String>()
180179

181180
detailedConfigFiles.forEach { runConfig ->

runtime/nativeMain/src/kotlinx/benchmark/native/NativeExecutor.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ class NativeExecutor(name: String, args: Array<out String>) : SuiteExecutor(name
209209
): Double {
210210
val executeFunction = benchmark.function
211211
var counter = cycles
212-
GC.collect()
212+
if (nativeGCCollectMode == NativeGCCollectMode.Iteration)
213+
GC.collect()
213214
val startTime = getTimeNanos()
214215
while (counter-- > 0) {
215216
@Suppress("UNUSED_VARIABLE")
@@ -234,7 +235,8 @@ class NativeExecutor(name: String, args: Array<out String>) : SuiteExecutor(name
234235
repeat(warmupIterations) { iteration ->
235236
val benchmarkNanos = config.iterationTime * config.iterationTimeUnit.toMultiplier()
236237
val executeFunction = benchmark.function
237-
GC.collect()
238+
if (config.nativeGCCollectMode == NativeGCCollectMode.Iteration)
239+
GC.collect()
238240
val startTime = getTimeNanos()
239241
var endTime = startTime
240242
iterations = 0

0 commit comments

Comments
 (0)