So I wanted to throw a similar benchmark in. I took a twitter bootstrap example page and converted it into xhtml strict. After that, I setup exactly one ApplicationScoped CDI bean that returned Hello, World. I put the EL expression on the page. For the JSF version, I used the JSF resource handler, for the JSPX version, I used HTML style css and js includes.
I used apache bench to test the main page load time. The test was performed on an un-optimized TomEE+ v1.5.2 server. I ran each benchmark 5x, then ran a full GC before taking a measurement. Bost tests were done in the same JVM instance without restarting the JVM. I have the APR available on the libpath, but I'm not sure that affects this test.
JSF is slower, but not by a whole lot, since we're dealing with very small quantities. What is not demonstrated is as the pages get more complex, does JSF/JSPX scale linearly or exponentially.
One thing I noticed is that JSPX is produces very little garbage compared to JSF. Running the benchmark on the JSPX page caused the used heap to jump from 184mb to 237mb. Running the benchmark in the same JVM on the JSF page causes the used heap to jump from 108mb to at least 404mb, but an automatic garbage collection kicked in at that point. It would seem tuning your garbage collector for JSF is an absolute necessity.
JSF
jonfisher@peanut:~$ /usr/local/bin/ab -n 10000 -c 100 http://localhost:8080/cdi-jsp/index.jsf
This is ApacheBench, Version 2.3 <$Revision: 1373084 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /cdi-jsp/index.jsf
Document Length: 2904 bytes
Concurrency Level: 100
Time taken for tests: 2.138 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 32160000 bytes
HTML transferred: 29040000 bytes
Requests per second: 4677.27 [#/sec] (mean)
Time per request: 21.380 [ms] (mean)
Time per request: 0.214 [ms] (mean, across all concurrent requests)
Transfer rate: 14689.55 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.3 1 21
Processing: 1 20 9.0 18 63
Waiting: 1 19 8.8 17 62
Total: 2 21 8.8 20 64
Percentage of the requests served within a certain time (ms)
50% 20
66% 23
75% 25
80% 27
90% 32
95% 39
98% 46
99% 50
100% 64 (longest request)
JSPX
jonfisher@peanut:~$ /usr/local/bin/ab -n 10000 -c 100 http://localhost:8080/cdi-jsp/page2.jspx
This is ApacheBench, Version 2.3 <$Revision: 1373084 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /cdi-jsp/page2.jspx
Document Length: 2440 bytes
Concurrency Level: 100
Time taken for tests: 1.273 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 26290000 bytes
HTML transferred: 24400000 bytes
Requests per second: 7856.63 [#/sec] (mean)
Time per request: 12.728 [ms] (mean)
Time per request: 0.127 [ms] (mean, across all concurrent requests)
Transfer rate: 20170.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 5 2.3 6 20
Processing: 1 8 4.6 6 40
Waiting: 1 8 4.3 6 40
Total: 2 13 3.8 12 41
Percentage of the requests served within a certain time (ms)
50% 12
66% 12
75% 13
80% 13
90% 17
95% 20
98% 24
99% 28
100% 41 (longest request)