-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gatling for performance tests #24
Comments
Hm... I was trying different options, but I couldn't make them work well:
Well... I don't know. I was trying to play with Groovy and JMH, it collides with the Java project and tries to compile code that we don't need to the load/performance tests. I don't see anything better than using Apache Benchmark. Maybe automate it with a simple groovy script or shell, or python, or something simple. @jreijn, here I feel helpless. Maybe you can give you a try. If you want, I can create a "gatling" branch, so you can see it, but I don't know any better solution. |
@Vest thanks. Sorry that I have not given this project much time. With the new year I'm going to spend some time to improve the project and perhaps we should split the project for benchmarking the template engines (just the engines) with JMH. |
I saw one project somewhere in github, where these engines were tested without any web stack. So just raw template in, and raw HTML out. But I don't know if this is a fair comparison, between engines, because some of them might have weak points such as concurrency, caching, or I/O. |
I have successfully configured the spring-comparing-template-engines with JMH working correctly with Spring MVC and all template engines of this project, except for JSP. This way we are evaluating the performance of the Spring MVC stack with each template engine and discarding the overhead of the HTTP conversation. To that end, I am using @Setup(Level.Trial)
public synchronized void startupSpring() {
try {
if (context == null) {
context = SpringApplication.run(Launch.class);
mockMvc = MockMvcBuilders
.webAppContextSetup((WebApplicationContext) context)
.build();
}
} catch (Exception e) {
//Force JMH crash
throw new RuntimeException(e);
}
}
@TearDown(Level.Trial)
public synchronized void shutdownSpring() {
try {
if (context != null) {
SpringApplication.exit(context);
context = null;
}
} catch (Exception e) {
//Force JMH crash
throw new RuntimeException(e);
}
} IMHO this is the most effective approach to benchmark the Spring MVC with different template engines. We have all the advantages of JMH with reliable isolation, measurement, warm-up, etc. The only drawback is that we are unable to test JSP. In truth, JSP runs without errors, but the response content is empty, and we cannot effectively measure that engine because the Spring MVC Test doesn't run that servlet container (https://stackoverflow.com/a/37749746/1140754) If you consider it useful, I can make a PR with my fork. Also, I included new unit tests to check whether the engines are returning the correct HTML. Those tests allowed me to understand that JSP was not rendering anything. |
Hi @fmcarvalho . Thanks for sharing the information. I'm definitely interested in your efforts. If you are willing to share or create a PR I would love to learn more. With regards to JSP I ran into something similar when trying to write a test for it. |
@jreijn Any news? |
@fmcarvalho sorry for the late reply! I'll try to take a look at this weekend. |
I was thinking of adding Gatling during the build cycle to do some performance tests, after which we can measure the results.
The text was updated successfully, but these errors were encountered: