I am working on porting 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 application performance using JSF 2 is terrible.
I noticed this problem when an ajax request was sent, JSF 2 displays the whole view, although the render attribute points to a single outputText
Example (can be downloaded from HERE )
In my example, I will use the same code example for JSF 1.2 and 2.2. After that, I press the ajax button several times and measure the response time for each request using the chrome check tool.
Given the following index1.XHTML using JSF 1.2 and Richfaces 3.3.4
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a="http://richfaces.org/a4j">
<head>
</head>
<body id="body">
<h:form>
<a:commandButton value="TestBtn" reRender="output"/>
</h:form>
<h:outputText value="test" id="output"/>
</body>
</html>
By pressing "TestBtn" several times, the average time is 15 ms:

Given the following index 2.XHTML using JSF 2.2 and Richfaces 4.5.0
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a="http://richfaces.org/a4j">
<h:head>
</h:head>
<h:body id="body">
<h:form>
<a:commandButton value="TestBtn" render="output"/>
</h:form>
<h:outputText value="test" id="output"/>
</h:body>
</html>
By pressing "TestBtn" several times, the average time is 18 ms:

Well, so far so good. Now a performance issue occurs when I add the following outputText elements
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
<h:outputText value="testingElement"/>
............. (300 times, of course this is just for testing purposes)
I added this element 300 times to index1.xhtml and index2.xhtml and repeated the same tests
Results using index1.xhtml (JSF 1.2), I got an average time of 19 ms

Results using index2.xhtml (JSF 2.2), I got an average time of 150 ms (!!!!!)

which is 8 times slower than JSF 1.2
Can someone explain why JSF 2 is slower than JSF 1? and how can i improve performance?
UPDATE
JSF 2 tomcat, 20 . , Wildfly.
Unfortuanlty . JSF 2 wildfly.
wildfly 8.2.0 → - .
, googling, POST
, JDK jdk1.7.0_71 → - .
2
ajax ( ), Wildfly. (LOG)
JSF , ?
** . , JSF, . **
, Advance,
Tefa