JSF Performance tuning
jsf, performance, primefaces
Solution
According to Chapter 1 of Core Java Server Faces, Pure HTML (static) passes through before the encoding phase of JSF tags.
If you've got some JSF tags which don't need to commune with a Backing Bean, I suspect you'd enjoy a small performance boost by keeping static data confined to vanilla HTML.
The encoding and decoding phrases of the JSF lifecycle translate between Component mark-up and vanilla HTML. This is only worthwhile to you if you're using a Component which saves you from looping over a table and populating the rows (for example) vs something like a `<h:outputText>` which isn't using ajax or bound to a backing bean, compared to a `<p>` html element.
In short, don't be frightened to use plain old HTML in your JSF documents if you don't need to take advantage of JSF acting as the Controller.
Problem
I use Mojara 2.0.3 with PrimeFaces 2.2. I've already read lots of posts in this topic and found some pretty suggestion (such as don't use db calls in getters and so on) and used them, but our app still needs ~3 sec to render the response. I tested it and the 6th lifecycle(render phase) is the largest resource consumer. We are mostly use built-in or composite component, and i wonder if it is good or bad to replace some of them (mostly used for design without any use of functionalities) with simple html tags. For example: Insted of `<p:outputPanel styleClass="myClass">...some code...</p:outputPanel>` using this ``` <div class="myClass">...some code...</div> ``` We have huge views with hundreds of components, and the thousands of DOM elements, and i can be a blocker in the rendering phase. EDIT: After I removed almost every "useless" component, we experienced a huge performance growth. Both in the response time and response size. The avarage response time decrased from ~3 sec to ~2.2 sec. Amazing... So the conclusion is: use less, get more :)