From e0755b1d14245ac9d4a08811438f9eb729645c5d Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 2 Aug 2018 16:15:11 +0100 Subject: [PATCH] Add extra flags benchmark for petclinic latest --- README.adoc | 8 +++---- .../com/example/PetclinicLatestBenchmark.java | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index e168a8d..a3f974a 100644 --- a/README.adoc +++ b/README.adoc @@ -165,10 +165,10 @@ before Spring Boot actually starts). ### Spring Boot 2.x -Spring Boot is slower. Early milestones were fine, but degradation -continued through the 2.0 development cycle. A lot of progress was -made between M7 and RC1, so I suppose it could be worse. Results -(before RC2): +Spring Boot is 2.0 is a bit slower and 2.1 is a bit faster. Early +milestones were fine, but degradation continued through the 2.0 +development cycle. A lot of progress was made between M7 and RC1, so I +suppose it could be worse. Results (before RC2): ``` Benchmark Mode Cnt Score Error Units diff --git a/benchmarks/src/main/java/com/example/PetclinicLatestBenchmark.java b/benchmarks/src/main/java/com/example/PetclinicLatestBenchmark.java index c269d65..01de59a 100644 --- a/benchmarks/src/main/java/com/example/PetclinicLatestBenchmark.java +++ b/benchmarks/src/main/java/com/example/PetclinicLatestBenchmark.java @@ -56,6 +56,11 @@ public void explodedJarMain(MainState state) throws Exception { state.run(); } + @Benchmark + public void explodedJarFlags(FlagsState state) throws Exception { + state.run(); + } + @Benchmark public void devtoolsRestart(ExplodedDevtoolsState state) throws Exception { state.run(); @@ -109,6 +114,24 @@ public void stop() throws Exception { } } + @State(Scope.Benchmark) + public static class FlagsState extends ProcessLauncherState { + public FlagsState() { + super("target/demo", "-noverify", "-XX:TieredStopAtLevel=1", + "-Djava.security.egd=file:/dev/./urandom", + "-Dspring.config.location=classpath:/application.properties", + "-Dspring.jmx.enabled=false", "-cp", CLASSPATH, + "org.springframework.samples.petclinic.PetClinicApplication", + "--server.port=0"); + unpack("target/demo", jarFile("com.example:petclinic-latest:jar:boot:1.4.2")); + } + + @TearDown(Level.Iteration) + public void stop() throws Exception { + super.after(); + } + } + @State(Scope.Benchmark) public static class ExplodedDevtoolsState extends DevToolsLauncherState {