One of the areas of JSF that I think suffers compared to other models such as JSP, PHP, etc is that it requires two paths instead of one. In JSP, for example, code is compiled directly into Java bytecode. That code is then directly executed when the servlet is accessed. As a result, a single path is executed to render the content to the output stream. In JSF on the other hand, first a component tree is created and renderers associated with it. Once that tree is constructed and JSF enters the render phase, the tree is walked completely and content is written to the output stream. Thus, JSF requires two paths: one to create the tree and one to render it. As a result, JSF has overhead associated with it. On the plus side, that overhead buys the developer a much improved programming model and better MVC implementation. The component tree is a stateful tree that allows state to be associated to components (ie: a value for an input component). This allows JSF to have a very clean model for performing validation, actions, and rendering. However, I believe that the tree mechanism can be improved from a performance standpoint.
(more…)
