-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
170 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
benchmarks/multiplatform/benchmarks/src/desktopMain/kotlin/Benchmarks.desktop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import java.io.File | ||
import java.time.LocalDateTime | ||
import java.time.format.DateTimeFormatter | ||
|
||
actual fun saveBenchmarksOnDisk(name: String, stats: BenchmarkStats) { | ||
val file = File("build/benchmarks/$name.csv") | ||
val keyToValue = mutableMapOf<String, String>() | ||
keyToValue.put("Date", | ||
LocalDateTime.now().format( | ||
DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss") | ||
) | ||
) | ||
stats.putFormattedValuesTo(keyToValue) | ||
if (!file.exists()) { | ||
file.parentFile?.mkdirs() | ||
file.appendText(keyToValue.keys.joinToString(",") + "\n") | ||
} | ||
file.appendText(keyToValue.values.joinToString(",") { it.replace(",", ";") } + "\n") | ||
println("Results saved to ${file.absolutePath}") | ||
println() | ||
} |
4 changes: 4 additions & 0 deletions
4
benchmarks/multiplatform/benchmarks/src/iosMain/kotlin/Benchmarks.ios.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
actual fun saveBenchmarksOnDisk(name: String, stats: BenchmarkStats) { | ||
// ignore | ||
// not implemented because it is difficult to transfer the file to the host system | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
benchmarks/multiplatform/benchmarks/src/macosMain/kotlin/Benchmarks.macos.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
actual fun saveBenchmarksOnDisk(name: String, stats: BenchmarkStats) { | ||
// ignore | ||
// not implemented yet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
benchmarks/multiplatform/benchmarks/src/wasmJsMain/kotlin/Benchmarks.wasmJs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
actual fun saveBenchmarksOnDisk(name: String, stats: BenchmarkStats) { | ||
// ignore | ||
// not implemented because it is difficult to transfer the file to the host system | ||
} |