I cloned this from closed issue
JAVASERVERFACES-2334 since the issue is getting worse with subsequent releases of Mojarra.
This is from original post
<f:ajax> tag degrades to performance of regular JSF 2 post as the xhtml page size increases. Attached is a sample xhtml page and backing bean that exhibits the problem. The page has 2 <f:form> tags the first one is very small and has the <f:agax> tag. The second <h:form> is large and contains a lot of html. Problem happens in GlassFish 3.1.1, JBoss 7.1 and Tomcat 7.0
Using javax.faces.FULL_STATE_SAVING_VIEW_IDS makes no difference in performance. -->
We have gone from 1.7 seconds for the attached example to 3.5 seconds by upgrading from Mojarra 2.1.5 to Mojarra 2.1.11. This is more than just an AJAX issue. Rendering of pages is slow and gets slower as the page size increases. By debugging Mojarra code I have found that for every "entry" in a page processed the tree is walked from the top node down. It finds the correct positions of the nodes to be modified by walking the tree 100s of times per page load. Is there a way Hash maps or other data structures could be used to avoid walking the full tree so many times per page load?
We have many pages where just the rendering, Post or AJAX request takes several seconds even if there is no database access. There is no way to support multiple users when a page load takes 2 or more seconds at 100% CPU utilization. Rendering of the page should be in fractions of a second and not take longer than database access.