It would be nice if we could test the differences in performance between different Javalin versions. We could create a simple test setup like this: https://github.com/orangy/http-benchmarks
Things to include:
Things not to include
Hi, I want to help.
But no idea about how to start.
Create another repo for benchmarks ?
@vn7n24fzkq, a new repo would be fine for this. I could make one in the javalin organization?
Sure, that sounds great.
@vn7n24fzkq, I've given you write access to https://github.com/javalin/performance
I suggest you start by just copying https://github.com/orangy/http-benchmarks, but instead of different frameworks you add different versions of Javalin. This will cover the "Hello World" type test, then we can build on that later.
OK, I will do that.
I am already add benchmarks suite.
And I need some advice on different version of javalin in maven.
I am trying to use maven-shade-plugin as a solution, but not sure it will be good idea.
Not sure if this is helpful: https://dzone.com/articles/java-classloader-handling
If you can shade the different versions to contain the version names, that should be okay 馃
How is this going @vn7n24fzkq ?
I am sorry that I didn't reply in time due to the busy work in recently.
I have tried classloader and it could be a solution, but this is means I need pre-download different version of javalin in repo.
I am not sure about that pre-download is right way.
I don't think there's a right or wrong way here. Adding 10+ different versions of the same library to a project is always going to be "wrong", so whatever works is fine. Classloader, shading, multiple modules, it doesn't really matter, as long as you're able to run the different versions independent of one another.
Got it , I will do it as soon as possible.
I am already create a simple benchmark for version 1.0.0 , but no idea about how to create a anonymous class with classloader 馃
Cuz create a route path need add a anonymous Handler class
@vn7n24fzkq How is this going?
Sorry I still not found any way for create anonymous class in class loader,maybe the better way is create JMH for each version with same test methods in repo ?
Sorry @vn7n24fzkq, I must have forgotten to reply. If you make them all different modules, then I guess they can have completely independent dependency trees. Could you try that?
Sure.
@tipsy I am already make JMH can run with different version of Javalin via command
./gradlew -PjavalinVersion=3.0.0 run
Current version contain 1.0.0 and 3.0.0 .
How do you think ?
Cool, let me try it!
Nice work, running it for one version works great! Are you able to create comparisons between different versions?
Sure.
But I can't run different version together at same time.
I can write a script like linux sh or window batch to execute all version benchmarks if needed.
It would be cool if we could define a base version and run comparisons against that, and get report like "3% improvement in requests per second" 馃
@tipsy
Sorry about the delay, I was add some commit.
Now you can run benchmark with command.
./gradlew benchmark -PjavalinVersion=1.0.0

./gradlew benchmark -PjavalinVersion=3.0.0

After two benchmark, you can compare those results.
./gradlew compare -Pbaseline=1.0.0 -PjavalinVersion=3.0.0
It looks like.

I also update README.md.
Very cool! I'll try it out this weekend.
@vn7n24fzkq I managed to run it for 1.0.0 and 3.0.0, but when I try to run it for 3.4.0 and above I get the following error:
> gradlew build
> Task :kaptKotlin
w: [kapt] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: org.openjdk.jmh.generators.BenchmarkProcessor (NON_INCREMENTAL).
> Task :compileKotlin FAILED
e: C:\Users\David\GitHub\performance\src\main\kotlin\javalin\performance\Benchmarks.kt: (30, 13): Unresolved reference: JavalinBenchmark
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
3 actionable tasks: 3 executed
Do you know why this happens?
@tipsy It's my fault. Because currently the benchmark only be able to run with version 1.0.0, 2.0.0, 3.0.0, 3.1.0, 3.2.0 and 3.3.0.

I will add other versions later.
Ah, I didn't notice that part! I can also add the rest of the versions :)
Sounds great 馃槃
I can also do it at tomorrow.
@tipsy Hi, I was added the rest of the versions.
@vn7n24fzkq Great, thank you!
I think this can be closed now, thanks a lot for your great work @vn7n24fzkq !
Most helpful comment
@tipsy
Sorry about the delay, I was add some commit.
Now you can run benchmark with command.
After two benchmark, you can compare those results.
It looks like.

I also update README.md.