Why does JSF 2.2 take longer by partially making an ajax request to Wildfly

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">
        <!-- Later the outputText elements below will be included here-->
        <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:

enter image description here

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">
        <!-- Later the outputText elements below will be included here-->
        <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:

enter image description here

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

enter image description here

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

enter image description here

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

+4
3

- , ajax Wildfly .

, JSF mojarra. Wildfly ( )

"org.jboss.as.weld" wildfly. wildfly . .

/ Wildfly, / 2 standalone.xml, "{JBOSS_HOME}//" ( ):

<extensions>
    ..............
    <extension module="org.jboss.as.weld"/>
    ..............
</extensions>
<profile>
     ..............
    <subsystem xmlns="urn:jboss:domain:weld:2.0"/>
</profile>

, , ajax

, , , .

, -

+4

, Primefaces Richfaces. 12 . , - javascript Richfaces. Primefaces, , , , .

Jsf 2.2 300 outputText with Primefaces

0

Richfaces, h: commandButton 300 outputTexts, bean, PanelGroup. , . , , JIRA Mojarra, .

Here are my results. I dropped the first request to rule out any initialization effect. Perhaps the most noticeable difference is that the last 5 requests are average, since the response time has stopped fluctuating by this time (maybe some optimization has been optimized).

Using Mojarra 2.2.6:

Sample size: 20
Total time:  2111 ms
Average time: 105.55 ms
STDDEV: 22.01
Last 5 average: 85.40 ms

Using Mojarra 2.1.28:

Sample size: 20
Total time:  1331 ms
Average time: 66.55 ms
STDDEV: 29.94
Last 5 average: 39.60 ms
0
source

All Articles