-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Gradle * Fix published * Update libraries * Fix inheritances issue * Add Kover * Add benchmark * Increase version * Fix test action
- Loading branch information
Showing
14 changed files
with
113 additions
and
13 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
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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
[versions] | ||
kotlin = "1.9.23" | ||
kotlinx-datetime = "0.5.0" | ||
kotest = "5.8.1" | ||
kotlinx-datetime = "0.6.0" | ||
kotest = "5.9.0" | ||
kover = "0.7.6" | ||
benchmark = "0.4.10" | ||
|
||
[libraries] | ||
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" } | ||
kotlinx-benchmark = { group = "org.jetbrains.kotlinx", name = "kotlinx-benchmark-runtime", version.ref = "benchmark" } | ||
kotest-assetions = { group = "io.kotest", name = "kotest-assertions-core", version.ref = "kotest" } | ||
|
||
|
||
[plugins] | ||
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } | ||
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } | ||
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } | ||
benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "benchmark" } |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
plugins { | ||
alias(libs.plugins.multiplatform) | ||
alias(libs.plugins.benchmark) | ||
alias(libs.plugins.kover) apply false | ||
} | ||
|
||
kotlin { | ||
jvm { | ||
compilations.all { | ||
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() | ||
} | ||
} | ||
linuxX64() | ||
mingwX64() | ||
macosX64() | ||
js(IR) { | ||
browser() | ||
nodejs() | ||
} | ||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(project(":kcron-common")) | ||
implementation(libs.kotlinx.benchmark) | ||
} | ||
} | ||
} | ||
} | ||
|
||
benchmark { | ||
targets { | ||
register("jvm") | ||
register("js") | ||
register("linuxX64") | ||
register("mingwX64") | ||
register("macosX64") | ||
} | ||
} |
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,32 @@ | ||
package benchmarks.builder | ||
|
||
import com.ucasoft.kcron.Cron | ||
import com.ucasoft.kcron.core.builders.DelicateIterableApi | ||
import com.ucasoft.kcron.core.extensions.years | ||
import kotlinx.benchmark.* | ||
|
||
@BenchmarkMode(Mode.AverageTime) | ||
@OutputTimeUnit(BenchmarkTimeUnit.MICROSECONDS) | ||
@Warmup(iterations = 2) | ||
@State(Scope.Benchmark) | ||
open class Iterate { | ||
|
||
@Param("1", "10", "100", "1000", "10000") | ||
var take = 1 | ||
|
||
private val builder = Cron.builder() | ||
|
||
@Setup | ||
fun prepare() { | ||
builder | ||
.years(2050..2055) | ||
} | ||
|
||
@OptIn(DelicateIterableApi::class) | ||
@Benchmark | ||
fun iterate(bh: Blackhole) { | ||
for (date in builder.asIterable().take(take)) { | ||
bh.consume(date) | ||
} | ||
} | ||
} |
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