Inspired by https://github.com/lu4242/performance-comparison-java-web-frameworks
I took the JSF application, ported it to CDI and created profiles for MyFaces 4 and Mojarra 4. The JMeter config is preconfigured for 100 threads and 200 loops.
Its also quite interesting compared to another case (http://tandraschko.blogspot.com/2019/03/way-to-myfaces-30.html), where the results of Mojarra 2.3 and MyFaces 2.3 were almost the same and MyFaces 2.3-next was ~15% faster as both Mojarra 2.3 and MyFaces 2.3. The big difference is that this benchmark simulates a real-world application with Hibernate and a bit business logic.
NOTE: MyFaces and Mojarra are both configured for better performance. It does not test stateless view or MyFaces ViewPooling. There should not be a big difference.
Average | Median | 90th pct | Throughput | |
---|---|---|---|---|
Mojarra 4 | 2.80ms | 2.00ms | 3.00ms | 4373.13 |
MyFaces 4 | 1.18ms | 1.00ms | 2.00ms | 4526.78 |
Currently only tested on Windows 11 + JDK 11 (Adoptium)
- download Tomcat 10.1.X
- extract it 2 times (tomcat-myfaces, tomcat-mojarra)
- copy the server.xml file from ./tomcat/conf to all 2 instances, which disables autoDeployment and accessLogValve
- go the ./application
- mvn clean package -Pmyfaces, copy the generated war and extract it to ./tomcat-myfaces/webapps/jsfbench
- mvn clean package -Pmojarra, copy the generated war and extract it to ./tomcat-mojarra/webapps/jsfbench
- download JMeter 5.6+
- Increase MaxUserPort if you are on Windows: https://deploymentresearch.com/research/post/532/fix-for-windows-10-exhausted-pool-of-tcp-ip-ports
- run one of the tomcats (e.g. ./tomcat-myfaces/bin/startup.bat)
- run jmeter (./jmeter/bin/jmeter.bat)
- open the ./application.jmx via JMeter
- run it once for a warmup
- clean the results
- run again and see the results under Test Plan/Thread Group/Aggregate Grapp