Skip to content

Commit

Permalink
Add deep version
Browse files Browse the repository at this point in the history
  • Loading branch information
IRus committed Jan 11, 2021
1 parent a24c12f commit 227a12b
Show file tree
Hide file tree
Showing 19 changed files with 1,608 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ out
build
.gradle
.DS_Store
generated/
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ find . -name '*.tar' |xargs ls -lh |grep -v original |grep -v common
```
# Execution time
# 2 classes
time (for i in {1..10}; do ./baseline/build/install/baseline/bin/baseline; done)
time (for i in {1..10}; do ./bootique2/build/install/bootique2/bin/bootique2; done)
time (for i in {1..10}; do ./cayennedi/build/install/cayennedi/bin/cayennedi; done)
Expand All @@ -33,24 +35,53 @@ 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 ./kodein/build/install/kodein/bin/kodein; done)
# 100 classes
time (for i in {1..10}; do ./baseline-deep/build/install/baseline-deep/bin/baseline-deep; done)
time (for i in {1..10}; do ./bootique2-deep/build/install/bootique2-deep/bin/bootique2-deep; done)
time (for i in {1..10}; do ./cayennedi-deep/build/install/cayennedi-deep/bin/cayennedi-deep; done)
time (for i in {1..10}; do ./dagger-deep/build/install/dagger-deep/bin/dagger-deep; done)
time (for i in {1..10}; do ./guice-deep/build/install/guice-deep/bin/guice-deep; done)
time (for i in {1..10}; do ./komodo-deep/build/install/komodo-deep/bin/komodo-deep; done)
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 ./kodein-deep/build/install/kodein-deep/bin/kodein-deep; done)
```

```
# Lines of code
# Lines of code for 2 classes
cloc ./baseline/src
cloc ./bootique2/src
cloc ./cayennedi/src
cloc ./dagger/src
cloc ./dagger/src/main/java
cloc ./guice/src
cloc ./komodo/src
cloc ./owb/src
cloc ./spring/src
cloc ./springboot/src
cloc ./koin/src
cloc ./kodein/src
# Lines of code for 100 classes
cloc ./baseline-deep/src
cloc ./bootique2-deep/src
cloc ./cayennedi-deep/src
cloc ./dagger-deep/src/main/java
cloc ./guice-deep/src
cloc ./komodo-deep/src
cloc ./owb-deep/src
cloc ./spring-deep/src
cloc ./springboot-deep/src
cloc ./koin-deep/src
cloc ./kodein-deep/src
```

## Results (JDK 11)
## Results for 2 classes (JDK 11)

|DI|Jar w/Deps Size, Mb|:arrow_down: Exec time, s|LoC|
|----|----|----|----|
Expand All @@ -59,9 +90,25 @@ cloc ./kodein/src
|Cayenne DI|1.8|2.05|37|
|Koin|1.8|2.56|16|
|Kodein|2.4|2.93|17|
|Bootique 2|4.2|4.31|52|
|Bootique|4.2|4.31|52|
|Guice|5.4|6.22|33|
|Komodo|6.4|7.56|17|
|Spring|5.5|8.36|23|
|OpenWebBeans|3.0|10.02|35|
|Spring Boot|9.2|26.94|42|

## Results for 2 classes (JDK 11)

|DI|Jar w/Deps Size, Mb|:arrow_down: Exec time, s|LoC|
|----|----|----|----|
|Baseline|1.8|2.28|107|
|Dagger|2.69|1.41|534|
|Cayenne DI||||
|Koin||||
|Kodein||||
|Bootique||||
|Guice||||
|Komodo||||
|Spring||||
|OpenWebBeans||||
|Spring Boot||||
18 changes: 18 additions & 0 deletions baseline-deep/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
kotlin("jvm").version("1.4.30-M1")
application
}

application {
mainClass.set("io.heapy.baseline.MainKt")
}

repositories {
jcenter()
}

dependencies {
implementation(project(":common-deep"))

implementation(kotlin("stdlib-jdk8"))
}
110 changes: 110 additions & 0 deletions baseline-deep/src/main/java/io/heapy/baseline/Main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package io.heapy.baseline

import io.heapy.sample.common2.*

fun main() {
val s101 = DefaultService101()
val s100 = DefaultService100(s101)
val s99 = DefaultService99(s100)
val s98 = DefaultService98(s99)
val s97 = DefaultService97(s98)
val s96 = DefaultService96(s97)
val s95 = DefaultService95(s96)
val s94 = DefaultService94(s95)
val s93 = DefaultService93(s94)
val s92 = DefaultService92(s93)
val s91 = DefaultService91(s92)
val s90 = DefaultService90(s91)
val s89 = DefaultService89(s90)
val s88 = DefaultService88(s89)
val s87 = DefaultService87(s88)
val s86 = DefaultService86(s87)
val s85 = DefaultService85(s86)
val s84 = DefaultService84(s85)
val s83 = DefaultService83(s84)
val s82 = DefaultService82(s83)
val s81 = DefaultService81(s82)
val s80 = DefaultService80(s81)
val s79 = DefaultService79(s80)
val s78 = DefaultService78(s79)
val s77 = DefaultService77(s78)
val s76 = DefaultService76(s77)
val s75 = DefaultService75(s76)
val s74 = DefaultService74(s75)
val s73 = DefaultService73(s74)
val s72 = DefaultService72(s73)
val s71 = DefaultService71(s72)
val s70 = DefaultService70(s71)
val s69 = DefaultService69(s70)
val s68 = DefaultService68(s69)
val s67 = DefaultService67(s68)
val s66 = DefaultService66(s67)
val s65 = DefaultService65(s66)
val s64 = DefaultService64(s65)
val s63 = DefaultService63(s64)
val s62 = DefaultService62(s63)
val s61 = DefaultService61(s62)
val s60 = DefaultService60(s61)
val s59 = DefaultService59(s60)
val s58 = DefaultService58(s59)
val s57 = DefaultService57(s58)
val s56 = DefaultService56(s57)
val s55 = DefaultService55(s56)
val s54 = DefaultService54(s55)
val s53 = DefaultService53(s54)
val s52 = DefaultService52(s53)
val s51 = DefaultService51(s52)
val s50 = DefaultService50(s51)
val s49 = DefaultService49(s50)
val s48 = DefaultService48(s49)
val s47 = DefaultService47(s48)
val s46 = DefaultService46(s47)
val s45 = DefaultService45(s46)
val s44 = DefaultService44(s45)
val s43 = DefaultService43(s44)
val s42 = DefaultService42(s43)
val s41 = DefaultService41(s42)
val s40 = DefaultService40(s41)
val s39 = DefaultService39(s40)
val s38 = DefaultService38(s39)
val s37 = DefaultService37(s38)
val s36 = DefaultService36(s37)
val s35 = DefaultService35(s36)
val s34 = DefaultService34(s35)
val s33 = DefaultService33(s34)
val s32 = DefaultService32(s33)
val s31 = DefaultService31(s32)
val s30 = DefaultService30(s31)
val s29 = DefaultService29(s30)
val s28 = DefaultService28(s29)
val s27 = DefaultService27(s28)
val s26 = DefaultService26(s27)
val s25 = DefaultService25(s26)
val s24 = DefaultService24(s25)
val s23 = DefaultService23(s24)
val s22 = DefaultService22(s23)
val s21 = DefaultService21(s22)
val s20 = DefaultService20(s21)
val s19 = DefaultService19(s20)
val s18 = DefaultService18(s19)
val s17 = DefaultService17(s18)
val s16 = DefaultService16(s17)
val s15 = DefaultService15(s16)
val s14 = DefaultService14(s15)
val s13 = DefaultService13(s14)
val s12 = DefaultService12(s13)
val s11 = DefaultService11(s12)
val s10 = DefaultService10(s11)
val s9 = DefaultService9(s10)
val s8 = DefaultService8(s9)
val s7 = DefaultService7(s8)
val s6 = DefaultService6(s7)
val s5 = DefaultService5(s6)
val s4 = DefaultService4(s5)
val s3 = DefaultService3(s4)
val s2 = DefaultService2(s3)
val s1 = DefaultService1(s2)
val s = DefaultService(s1)

println(s.name())
}
File renamed without changes.
11 changes: 11 additions & 0 deletions common-deep/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
kotlin("jvm").version("1.4.30-M1")
}

repositories {
jcenter()
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
}
Loading

0 comments on commit 227a12b

Please sign in to comment.