Skip to content

Commit

Permalink
fix test config
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgiuliani committed Sep 4, 2023
1 parent 1110c2a commit e7cbcf5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions examples/jvm-perfs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ tasks.getByName<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileKotlin"
}

val jmhVersion = "1.36"
val koin_version = "3.4.0"
val coroutines_version = "1.6.4"
//TODO get from existing version.gradle file
val koin_version = "3.5.0"
val coroutines_version = "1.7.3"

dependencies {
api("io.insert-koin:koin-core:$koin_version")
api("io.insert-koin:koin-core-coroutines:$koin_version")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
implementation("org.openjdk.jmh:jmh-core:$jmhVersion")
kapt("org.openjdk.jmh:jmh-generator-annprocess:$jmhVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ open class BenchmarkClass {
@Benchmark
fun start400() {
koinApplication {
modules(perfModule400().value)
modules(perfModule400())
}.koin
}

@Benchmark
fun start400AndInject() {
val koin = koinApplication {
modules(perfModule400().value)
modules(perfModule400())
}.koin
koinScenario(koin)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import org.koin.core.Koin
import org.koin.core.annotation.KoinExperimentalAPI
import org.koin.core.awaitAllStartJobs
import org.koin.core.lazyModules
import org.koin.core.time.measureDurationForResult
import org.koin.dsl.koinApplication
import kotlin.math.roundToInt
Expand All @@ -27,7 +25,7 @@ object PerfRunner {
fun runScenario(index: Int): Pair<Double, Double> {
val (app, duration) = measureDurationForResult {
koinApplication {
lazyModules(
modules(
perfModule400()
)
}
Expand All @@ -36,9 +34,9 @@ object PerfRunner {

val koin: Koin = app.koin

runBlocking {
koin.awaitAllStartJobs()
}
// runBlocking {
// koin.awaitAllStartJobs()
// }

val (_, executionDuration) = measureDurationForResult {
koinScenario(koin)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.koin.benchmark

import org.koin.dsl.lazyModule
import org.koin.dsl.module

fun perfModule400() = lazyModule {
fun perfModule400() = module {
single { A1() }
single { B1(get()) }
single { C1(get(), get()) }
Expand Down

0 comments on commit e7cbcf5

Please sign in to comment.