DEV Community

Mitz
Mitz

Posted on

Started enjoying spring-boot-startup-bench

Following s1p tweets, I found an interesting one this morning.

That’s why I enjoyed this repository today.
https://github.com/dsyer/spring-boot-startup-bench

Build failed

When I tried to build it with $ ./mvnw clean install, it failed. Reading the error message, I modified one line and the build succeeded.

https://github.com/bufferings/spring-boot-startup-bench/commit/4218301f4139274abe489ddaeb09058039184da7

Strange Result

Then I ran the benchmark with $ (cd benchmarks/; java -jar target/benchmarks.jar). But it showed a strange result.

The petclinicLatest(Precompute)Thin results were too slow.

Thin?

I didn’t know what the Thin means. Then I reached to https://github.com/dsyer/spring-boot-thin-launcher and understood it’s an experimental library to make the jar file thin and download jars when it starts for the first time.

I read the source code of the benchmark module to know how it runs the target, and added --thin.debug=true to see the debug output.

java -Xmx128m -Djava.security.egd=file:/dev/./urandom \
  -XX:TieredStopAtLevel=1 \
  -jar petclinic-latest/target/petclinic-latest-1.4.2-thin.jar \
  --thin.debug=true \
  --server.port=0
Enter fullscreen mode Exit fullscreen mode

SNAPSHOT?

I forgot to take a memo, but it showed jar resolution log. I noticed the petclinic-latest loaded some SNAPSHOT version libraries.

I guess every time it would check the SNAPSHOT version of the maven repository. So I modified the pom file to use RELEASE version.

https://github.com/bufferings/spring-boot-startup-bench/commit/17fb6be5511a928ebf26cc49d6044ce6ffdcd73d

Then…

Though it would be different from the original aim to compare the SNAPSHOT version speed, I enjoyed the repository, and I would like to understand the details of this repository especially Flux benchmarks which is on the tweet picture.

Discussion (0)