dev@javaserverfaces.java.net

Re: Performance improvement for FacesCompositeELResolver

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Sun, 31 Jan 2010 11:28:04 -0800

Thanks for taking the time to contribute.

If you could, please open an issue and attach your patch.

Thanks,
-rl

On 1/31/10 8:43 AM, Martin Aubele wrote:
> now complete
>
> Hello,
> we are working with Icefaces/Facelets/JSF in a very big project with
> feature rich UI.
> We recognized that we have almost 1.000.000 calls if
> FacesContext.getCurrentInstance() during processing of one page.
>
> We could see that JSF is not tuned very well here. Remember
> FacesContext.getCurrentInstance() is a loopup to a thread local map.
> Please avoid it if possible.
>
> In the attachement you see a patch for FacesCompositeELResolver that
> reduces these lookups form 3 to 1 during getValue().
>
> The patch is based on jsf 1.2 but should be done with small
> modifications also in jsf 2
>
>
> In general in FacesCompositeELResolver we find these lines repeated
> for several times:
>
> if (FacesContext.getCurrentInstance() == null) {
> return null;
> }
> setChainType();
> ...
> clearChainType();
>
>
> One call to find out if the context exists, in setChainType and
> clearChainType we read it again. So 3 calls instead of one.
> Code is tested very well.
> Thanks for your help.
>
>
> BR, Martin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>