I am working on migrating a project from (
JSF 1.2, Richfaces 3.3.4 running on
JBoss 4.2.3) to (JSF 2.2, Richfaces 4.5 running on Wildfly 8.1.0). After partially migrating some views I found that the performance of the application using JSF 2 is terrible.
I noticed this issue when an ajax request is sent, JSF 2 is rendering the whole view although the render attribute is pointing to one outputText
Example
In my example I will use the same code sample for both JSF 1.2 and 2.2. Afterwards I will click on the ajax button multiple times and measure the response time for each request using chrome inspection tool.
Given the following index1.XHTML using JSF 1.2 and Richfaces 3.3.4
Clicking on "TestBtn" multiple times, the average time is 15ms:
Given the following index2.XHTML using JSF 2.2 and Richfaces 4.5.0
Clicking on "TestBtn" multiple times, the average time is 18ms:
Well, so far so good. Now the performance issue comes when I add the following outputText elements
I added these element 300 times in both index1.xhtml and index2.xhtml and repeated the same tests
The results using index1.xhtml (JSF 1.2), I got average time of 19ms
The results using index2.xhtml (JSF 2.2), I got average time of 150ms (!!!)
Which is 8 times slower than JSF 1.2
Could someone explain please why JSF 2 is slower than JSF 1? and how can I improve the performance for this example?
Thanks in Advance,
Tefa