项目作者: andrus

项目描述 :
DI containers comparison
高级语言: Java
项目地址: git://github.com/andrus/di-comparison.git
创建时间: 2018-03-31T12:45:56Z
项目社区:https://github.com/andrus/di-comparison

开源协议:

下载


DI Containers Comparision

Comparing a simple app varieties on different DI containers.

IntelliJ IDEA Setup

Go to “Preferences > Annotation Processors”, and check “Enable Annotation
Processing”.

“Benchmark”

  1. # Build (can't compare build times, as module ordering affects the results)
  2. mvn clean package

File sizes

  1. find . -name '*.jar' |xargs ls -l |grep -v original |grep -v common

Execution time

  1. time java -jar ./bootique/target/bootique-*.jar
  2. time java -jar ./cayennedi/target/cayennedi-*.jar
  3. time java -jar ./dagger/target/dagger-*.jar
  4. time java -jar ./guice/target/guice-*.jar
  5. time java -jar ./owb/target/owb-*.jar
  6. time java -jar ./spring/target/spring-*.jar
  7. time java -jar ./springboot/target/springboot-*.jar

Results (Java 21)

MacBook Pro 2021 M1, 16GB RAM, OpenJDK Temurin-21+35

DI Jar w/Deps Size, KB :arrow_down: Exec time, ms
Dagger 58 90
Cayenne DI 71 105
Bootique 2894 157
Guice 3827 204
OpenWebBeans 1632 ? (failures)
Spring 4800 221
Spring Boot 10094 743