<div dir="ltr">Already tagged for follow up ;-)<br><br><div class="gmail_quote">On Mon, Jul 28, 2008 at 3:26 PM, Dan Allen <span dir="ltr"><<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Jay,<br>
<br>
This would be an excellent candidate for an experiement to conduct<br>
with the performance infrastructure...not that you really needed the<br>
reminder, but just thinking outloud.<br>
<br>
-Dan<br>
<div><div></div><div class="Wj3C7c"><br>
On Mon, Jul 28, 2008 at 2:59 PM, Sebastian Hennebrueder<br>
<<a href="mailto:usenet@laliluna.de">usenet@laliluna.de</a>> wrote:<br>
> Christian Bauer schrieb:<br>
>><br>
>> If any JSF guru knows how to control rendered="true|false" evaluation<br>
>> better, that would be useful:<br>
>><br>
>> <a href="http://jira.jboss.com/jira/browse/JBSEAM-3008" target="_blank">http://jira.jboss.com/jira/browse/JBSEAM-3008</a><br>
>><br>
>> _______________________________________________<br>
>> seam-dev mailing list<br>
>> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
>><br>
> Hello,<br>
><br>
> far away from being a guru of anything but I looked through the code.<br>
><br>
> Related to thie JBSEAM-3008 and the posting on<br>
> <a href="http://seamframework.org/Documentation/TuningTheSeamWebsite" target="_blank">http://seamframework.org/Documentation/TuningTheSeamWebsite</a><br>
><br>
> I evaluted JSF reference implementation 1.2.04<br>
><br>
> A component extending from UIComponentBase has a number of JSF phase<br>
> handler.<br>
> processRestoreState<br>
> processDecodes<br>
> processValidators<br>
> processUpdates<br>
> processSaveState<br>
><br>
> a get request is only calling processSaveState but a post request is calling<br>
> everything<br>
><br>
> The implementations are more or less iterating through the childs and<br>
> calling the child handlers<br>
><br>
> Three methods (<br>
> processDecodes<br>
> processValidators<br>
> processUpdates<br>
> ) are calling isRendered which in turn leads to an EL resolution.<br>
><br>
> In totally isRendered is called at least 5 times before an element is<br>
> rendered. Calls are not cached and the EL is evaluated every time.<br>
> Calling methods are encodeChild,encodeBegin/encodeEnd/encodeChildren and a<br>
> super class + 3 if the request is a post and the component extends<br>
> UIComponentBase<br>
><br>
> There are two consequences: one for a proper cache implementation and one<br>
> for performance<br>
><br>
> 1) cache<br>
> To have a proper cache implementation our cache component needs to overwrite<br>
> at least phase listener<br>
> processDecodes<br>
> processValidators<br>
> processUpdates<br>
> with an empty implementation. This will block all following updates as JSF<br>
> is always running through the object tree. As a consequence the cached<br>
> fragment should not be a form. The content will not be updated, even if it<br>
> is not yet cached. processSaveState and processRestoreState should not be<br>
> overwritten. It might be slightly inefficient but these methods fill the<br>
> component tree we need to cache.<br>
><br>
> Actually, I wanted to create a patch but where is the source for HtmlCache.<br>
> It seams not to be in seam-trunk. Anyway, just overwrite the three methods<br>
> and don't delegate to the parent class but leave it empty.<br>
><br>
><br>
> 2) performance<br>
> This is not related to the cache but a general JSF problem.<br>
> In the class org.jboss.seam.ui.util.cdk.RendererBase add two lines to<br>
> evaluate the rendered expression<br>
> and call setRendered and set the result of the evaluation. This will reduce<br>
> the calls for all components using this renderer to one call.<br>
><br>
> It would reduce the rendered EL calls by 80 % . The question is, if we will<br>
> see any side effects. If no components are doing funny things, it should<br>
> work. I would propose that we carefully test this in different applications.<br>
><br>
> public void renderChildren(FacesContext facesContext, UIComponent component)<br>
> throws IOException {<br>
> if (component.getChildCount() > 0) {<br>
> for (Iterator it = component.getChildren().iterator(); it.hasNext();) {<br>
> UIComponent child = (UIComponent) it.next();<br>
> // here the two lines<br>
> boolean rendered = child.isRendered();<br>
> child.setRendered(rendered);<br>
> renderChild(facesContext, child);<br>
> }<br>
> }<br>
><br>
><br>
> Best Regards<br>
><br>
> Sebastian Hennebrueder<br>
> ----<br>
> <a href="http://www.laliluna.de" target="_blank">www.laliluna.de</a><br>
> Training, Tutorials and Java Development<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> seam-dev mailing list<br>
> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
Dan Allen<br>
Software consultant | Author of Seam in Action<br>
<br>
<a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>
<br>
NOTE: While I make a strong effort to keep up with my email on a daily<br>
basis, life and work come first and, at times, keep me away from my mail<br>
for a while. If you contact me, then don't hear back for more than a week,<br>
it is very likely that I am excessively backlogged or the message was<br>
caught in the spam filters. Please don't hesitate to resend a message if<br>
you feel that it did not reach my attention.<br>
<div><div></div><div class="Wj3C7c">_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>blog: <a href="http://in.relation.to/Bloggers/Jay">http://in.relation.to/Bloggers/Jay</a><br>
</div>