webtier@glassfish.java.net

Re: JSF performance

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Tue, 01 Nov 2011 08:17:26 -0700

On 10/30/11 7:54 PM, forums_at_java.net wrote:
> We are seeing ajax requests take around 300ms in RENDER_RESPONSE when
> there
> is no back-end logic happening, just setting a boolean in
> UPDATE_MODEL_VALUES. When profiling it appears that over 50% of time
> is being
> spent in FaceletViewHandlingStrategy.buildView (called from
> RenderResponsePhase.execute). Why does buildView need to be called on
> a Ajax
> postback? Why do components that are not rendered need to be visited
> as part
> of buildView? Is there anyway to speed this up or prevent it from
> happening?
This is by design with partial state saving (the default state saving
mode in 2.x).
With partial state saving, the view structure isn't serialized, only the
component
state deltas. So when a post-back occurs, the view has to be rebuilt
before the
component state deltas can be re-applied.

As far as "Why do components that are not rendered need to be visited as
part of
buildView", They aren't being visited at this point. The view is just
being reconstructed
so that the relevant components of the ajax request may be visited.
There is currently
no concept of a partial view restore.

That said, you can try to see if performance is better by disabling
partial state saving
for this particular view. Keep in mind, this basically reverts to 1.2
semantics, so
you could be trading memory for speed. To do this, you need to add a
context init param
named 'javax.faces.FULL_STATE_SAVING_VIEW_IDS|' (less the quotes) with
the value being the
view ID you wish to test. Example: /largeAjaxView.xhtml.


|
>
>
> --
>
> [Message sent by forum member 'dgarth']
>
> View Post: http://forums.java.net/node/858699
>
>