diff --git a/README.md b/README.md index b1abca4..9bd2591 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ find . -name '*.tar' |xargs ls -lh |grep -v original |grep -v common ``` # Execution time +# JVM Baseline +time (for i in {1..10}; do ./jvm/build/install/jvm/bin/jvm; done) + # 2 classes time (for i in {1..10}; do ./baseline/build/install/baseline/bin/baseline; done) @@ -34,6 +37,7 @@ time (for i in {1..10}; do ./owb/build/install/owb/bin/owb; done) time (for i in {1..10}; do ./spring/build/install/spring/bin/spring; done) time (for i in {1..10}; do ./springboot/build/install/springboot/bin/springboot; done) time (for i in {1..10}; do ./koin/build/install/koin/bin/koin; done) +time (for i in {1..10}; do ./koin-reflect/build/install/koin-reflect/bin/koin-reflect; done) time (for i in {1..10}; do ./kodein/build/install/kodein/bin/kodein; done) # 100 classes @@ -48,6 +52,7 @@ time (for i in {1..10}; do ./owb-deep/build/install/owb-deep/bin/owb-deep; done) time (for i in {1..10}; do ./spring-deep/build/install/spring-deep/bin/spring-deep; done) time (for i in {1..10}; do ./springboot-deep/build/install/springboot-deep/bin/springboot-deep; done) time (for i in {1..10}; do ./koin-deep/build/install/koin-deep/bin/koin-deep; done) +time (for i in {1..10}; do ./koin-reflect-deep/build/install/koin-reflect-deep/bin/koin-reflect-deep; done) time (for i in {1..10}; do ./kodein-deep/build/install/kodein-deep/bin/kodein-deep; done) ``` @@ -81,6 +86,12 @@ cloc ./koin-deep/src cloc ./kodein-deep/src ``` +# Results for JVM (JDK 11) + +|DI|Jar w/Deps Size, Mb|:arrow_down: Exec time, s|LoC| +|----|----|----|----| +|JVM Baseline|TODO|TODO|-| + ## Results for 2 classes (JDK 11) |DI|Jar w/Deps Size, Mb|:arrow_down: Exec time, s|LoC| @@ -89,6 +100,7 @@ cloc ./kodein-deep/src |Dagger|1.7|1.41|37| |Cayenne DI|1.8|2.05|37| |Koin|1.8|2.56|16| +|Koin-Reflect|TODO|TODO|TODO| |Kodein|2.4|2.93|17| |Bootique|4.2|4.31|52| |Guice|5.3|6.51|33| @@ -104,6 +116,7 @@ cloc ./kodein-deep/src |Dagger|2.0|2.70|534| |Cayenne DI|2.0|3.70|1444| |Koin|2.1|3.92|113| +|Koin-Reflect|TODO|TODO|TODO| |Kodein|2.9|5.58|114| |Bootique|4.3|5.79|549| |Guice|5.4|8.70|530| diff --git a/baseline-deep/build.gradle.kts b/baseline-deep/build.gradle.kts index 202fbab..e7956fb 100644 --- a/baseline-deep/build.gradle.kts +++ b/baseline-deep/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/baseline/build.gradle.kts b/baseline/build.gradle.kts index 9fd5e1b..13c7378 100644 --- a/baseline/build.gradle.kts +++ b/baseline/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/bootique-deep/build.gradle.kts b/bootique-deep/build.gradle.kts index e314be4..5e7f7cd 100644 --- a/bootique-deep/build.gradle.kts +++ b/bootique-deep/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() maven { url = uri("https://maven.objectstyle.org/nexus/content/repositories/bootique-snapshots/") } diff --git a/bootique/build.gradle.kts b/bootique/build.gradle.kts index 6c60bf3..3c5a113 100644 --- a/bootique/build.gradle.kts +++ b/bootique/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() maven { url = uri("https://maven.objectstyle.org/nexus/content/repositories/bootique-snapshots/") } diff --git a/cayennedi-deep/build.gradle.kts b/cayennedi-deep/build.gradle.kts index b989140..2665b4b 100644 --- a/cayennedi-deep/build.gradle.kts +++ b/cayennedi-deep/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/cayennedi/build.gradle.kts b/cayennedi/build.gradle.kts index bca67bf..96790a5 100644 --- a/cayennedi/build.gradle.kts +++ b/cayennedi/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/common-deep/build.gradle.kts b/common-deep/build.gradle.kts index b0b3f0e..ca1ebac 100644 --- a/common-deep/build.gradle.kts +++ b/common-deep/build.gradle.kts @@ -1,9 +1,9 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/common-deep/src/test/kotlin/GenerateKoin.kt b/common-deep/src/test/kotlin/GenerateKoin.kt index c713294..487b164 100644 --- a/common-deep/src/test/kotlin/GenerateKoin.kt +++ b/common-deep/src/test/kotlin/GenerateKoin.kt @@ -4,4 +4,10 @@ fun main() { single { DefaultService$it(get()) } """.trimIndent()) } + + (1..101).forEach { + println(""" + singleBy() + """.trimIndent()) + } } diff --git a/common/build.gradle.kts b/common/build.gradle.kts index b0b3f0e..ca1ebac 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,9 +1,9 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/dagger-deep/build.gradle.kts b/dagger-deep/build.gradle.kts index 6a330c8..11249a9 100644 --- a/dagger-deep/build.gradle.kts +++ b/dagger-deep/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/dagger/build.gradle.kts b/dagger/build.gradle.kts index 1d8e4f8..a31668f 100644 --- a/dagger/build.gradle.kts +++ b/dagger/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f1577bd..6e61ea7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=a7ca23b3ccf265680f2bfd35f1f00b1424f4466292c7337c85d46c9641b3f053 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip +distributionSha256Sum=9af5c8e7e2cd1a3b0f694a4ac262b9f38c75262e74a9e8b5101af302a6beadd7 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/guice-deep/build.gradle.kts b/guice-deep/build.gradle.kts index 4f2e470..6fcd323 100644 --- a/guice-deep/build.gradle.kts +++ b/guice-deep/build.gradle.kts @@ -8,11 +8,11 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common-deep")) - implementation("com.google.inject:guice:5.0.0-BETA-1") + implementation("com.google.inject:guice:5.0.1") } diff --git a/guice/build.gradle.kts b/guice/build.gradle.kts index 91988d0..de17d7d 100644 --- a/guice/build.gradle.kts +++ b/guice/build.gradle.kts @@ -8,11 +8,11 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common")) - implementation("com.google.inject:guice:5.0.0-BETA-1") + implementation("com.google.inject:guice:5.0.1") } diff --git a/jvm/build.gradle.kts b/jvm/build.gradle.kts new file mode 100644 index 0000000..128e1a5 --- /dev/null +++ b/jvm/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + kotlin("jvm").version("1.4.31") + application +} + +application { + mainClass.set("org.objectstyle.jvm.MainKt") +} + +tasks.withType().configureEach { + kotlinOptions.jvmTarget = "11" +} + +repositories { + mavenCentral() +} + +dependencies { + implementation(kotlin("stdlib-jdk8")) +} diff --git a/jvm/src/main/kotlin/org/objectstyle/jvm/Main.kt b/jvm/src/main/kotlin/org/objectstyle/jvm/Main.kt new file mode 100644 index 0000000..020a457 --- /dev/null +++ b/jvm/src/main/kotlin/org/objectstyle/jvm/Main.kt @@ -0,0 +1,3 @@ +package org.objectstyle.jvm + +fun main() {} diff --git a/kodein-deep/build.gradle.kts b/kodein-deep/build.gradle.kts index 45e05c9..9aeafee 100644 --- a/kodein-deep/build.gradle.kts +++ b/kodein-deep/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -12,7 +12,7 @@ tasks.withType().configureEach } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/kodein/build.gradle.kts b/kodein/build.gradle.kts index cee6c39..d4c3795 100644 --- a/kodein/build.gradle.kts +++ b/kodein/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -12,7 +12,7 @@ tasks.withType().configureEach } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/koin-deep/build.gradle.kts b/koin-deep/build.gradle.kts index c32f740..1b29d3a 100644 --- a/koin-deep/build.gradle.kts +++ b/koin-deep/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -8,12 +8,12 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common-deep")) implementation(kotlin("stdlib-jdk8")) - implementation("org.koin:koin-core:2.2.1") + implementation("io.insert-koin:koin-core:3.0.1-beta-1") } diff --git a/koin-reflect-deep/build.gradle.kts b/koin-reflect-deep/build.gradle.kts new file mode 100644 index 0000000..ac954ef --- /dev/null +++ b/koin-reflect-deep/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + kotlin("jvm").version("1.4.31") + application +} + +application { + mainClass.set("io.heapy.koin.MainKt") +} + +repositories { + mavenCentral() +} + +dependencies { + implementation(project(":common-deep")) + + implementation(kotlin("stdlib-jdk8")) + implementation("io.insert-koin:koin-core:3.0.1-beta-1") + implementation("io.insert-koin:koin-core-ext:3.0.1-beta-1") +} diff --git a/koin-reflect-deep/src/main/kotlin/io/heapy/koin/Main.kt b/koin-reflect-deep/src/main/kotlin/io/heapy/koin/Main.kt new file mode 100644 index 0000000..ac4c0c9 --- /dev/null +++ b/koin-reflect-deep/src/main/kotlin/io/heapy/koin/Main.kt @@ -0,0 +1,117 @@ +package io.heapy.koin + +import io.heapy.sample.common2.* +import org.koin.dsl.koinApplication +import org.koin.dsl.module +import org.koin.experimental.builder.singleBy + +fun main() { + val s = koinApplication { + modules(module { + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + singleBy() + }) + }.koin.get() + + println(s.name()) +} diff --git a/koin-reflect/build.gradle.kts b/koin-reflect/build.gradle.kts new file mode 100644 index 0000000..1ce4cf3 --- /dev/null +++ b/koin-reflect/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + kotlin("jvm").version("1.4.31") + application +} + +application { + mainClass.set("org.objectstyle.koin.MainKt") +} + +repositories { + mavenCentral() +} + +dependencies { + implementation(project(":common")) + + implementation(kotlin("stdlib-jdk8")) + implementation("io.insert-koin:koin-core:3.0.1-beta-1") + implementation("io.insert-koin:koin-core-ext:3.0.1-beta-1") +} diff --git a/koin-reflect/src/main/kotlin/org/objectstyle/koin/Main.kt b/koin-reflect/src/main/kotlin/org/objectstyle/koin/Main.kt new file mode 100644 index 0000000..d28dba8 --- /dev/null +++ b/koin-reflect/src/main/kotlin/org/objectstyle/koin/Main.kt @@ -0,0 +1,20 @@ +package org.objectstyle.koin + +import org.koin.dsl.koinApplication +import org.koin.dsl.module +import org.koin.experimental.builder.singleBy +import org.objectstyle.di.service.Service +import org.objectstyle.di.service.ServiceImpl +import org.objectstyle.di.service.SubService +import org.objectstyle.di.service.SubServiceImpl + +fun main() { + val s = koinApplication { + modules(module { + singleBy() + singleBy() + }) + }.koin.get() + + println(s.doIt()) +} diff --git a/koin/build.gradle.kts b/koin/build.gradle.kts index b57ab78..e838091 100644 --- a/koin/build.gradle.kts +++ b/koin/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -8,12 +8,12 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common")) implementation(kotlin("stdlib-jdk8")) - implementation("org.koin:koin-core:2.2.1") + implementation("io.insert-koin:koin-core:3.0.1-beta-1") } diff --git a/komodo-deep/build.gradle.kts b/komodo-deep/build.gradle.kts index fefdbae..8618b40 100644 --- a/komodo-deep/build.gradle.kts +++ b/komodo-deep/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -12,9 +12,9 @@ tasks.withType().configureEach } repositories { - jcenter() + mavenCentral() maven { - url = uri("https://dl.bintray.com/heapy/heap-dev") + url = uri("https://repo.kotlin.link") } } @@ -22,5 +22,5 @@ dependencies { implementation(project(":common-deep")) implementation(kotlin("stdlib-jdk8")) - implementation("io.heapy.komodo:komodo-di:0.1.0-development+000084") + implementation("io.heapy.komodo:komodo-di:0.1.0-development.000092") } diff --git a/komodo/build.gradle.kts b/komodo/build.gradle.kts index f0ab37a..df75896 100644 --- a/komodo/build.gradle.kts +++ b/komodo/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm").version("1.4.30-M1") + kotlin("jvm").version("1.4.31") application } @@ -12,9 +12,9 @@ tasks.withType().configureEach } repositories { - jcenter() + mavenCentral() maven { - url = uri("https://dl.bintray.com/heapy/heap-dev") + url = uri("https://repo.kotlin.link") } } @@ -22,5 +22,5 @@ dependencies { implementation(project(":common")) implementation(kotlin("stdlib-jdk8")) - implementation("io.heapy.komodo:komodo-di:0.1.0-development+000084") + implementation("io.heapy.komodo:komodo-di:0.1.0-development.000092") } diff --git a/owb-deep/build.gradle.kts b/owb-deep/build.gradle.kts index 9dbbbef..54c4642 100644 --- a/owb-deep/build.gradle.kts +++ b/owb-deep/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/owb/build.gradle.kts b/owb/build.gradle.kts index a5cec92..2c21f03 100644 --- a/owb/build.gradle.kts +++ b/owb/build.gradle.kts @@ -8,7 +8,7 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/settings.gradle.kts b/settings.gradle.kts index dd49136..76a16e1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,11 +1,14 @@ include("common") include("common-deep") +include("jvm") include("baseline") include("baseline-deep") include("kodein") include("kodein-deep") include("koin") include("koin-deep") +include("koin-reflect") +include("koin-reflect-deep") include("komodo") include("komodo-deep") include("bootique") diff --git a/spring-deep/build.gradle.kts b/spring-deep/build.gradle.kts index 5096a91..bb505d1 100644 --- a/spring-deep/build.gradle.kts +++ b/spring-deep/build.gradle.kts @@ -8,11 +8,11 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common-deep")) - implementation("org.springframework:spring-context:5.2.5.RELEASE") + implementation("org.springframework:spring-context:5.3.4") } diff --git a/spring/build.gradle.kts b/spring/build.gradle.kts index 70df69d..05315bc 100644 --- a/spring/build.gradle.kts +++ b/spring/build.gradle.kts @@ -8,11 +8,11 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common")) - implementation("org.springframework:spring-context:5.2.5.RELEASE") + implementation("org.springframework:spring-context:5.3.4") } diff --git a/springboot-deep/build.gradle.kts b/springboot-deep/build.gradle.kts index bbed22b..db13649 100644 --- a/springboot-deep/build.gradle.kts +++ b/springboot-deep/build.gradle.kts @@ -8,11 +8,11 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common-deep")) - implementation("org.springframework.boot:spring-boot-starter:2.2.6.RELEASE") + implementation("org.springframework.boot:spring-boot-starter:2.4.3") } diff --git a/springboot/build.gradle.kts b/springboot/build.gradle.kts index fba8edf..c6819b9 100644 --- a/springboot/build.gradle.kts +++ b/springboot/build.gradle.kts @@ -8,11 +8,11 @@ application { } repositories { - jcenter() + mavenCentral() } dependencies { implementation(project(":common")) - implementation("org.springframework.boot:spring-boot-starter:2.2.6.RELEASE") + implementation("org.springframework.boot:spring-boot-starter:2.4.3") }