<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">&lt;<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>&gt;</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>
&lt;<a href="mailto:usenet@laliluna.de">usenet@laliluna.de</a>&gt; wrote:<br>
&gt; Christian Bauer schrieb:<br>
&gt;&gt;<br>
&gt;&gt; If any JSF guru knows how to control rendered=&quot;true|false&quot; evaluation<br>
&gt;&gt; better, that would be useful:<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://jira.jboss.com/jira/browse/JBSEAM-3008" target="_blank">http://jira.jboss.com/jira/browse/JBSEAM-3008</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; seam-dev mailing list<br>
&gt;&gt; <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
&gt;&gt;<br>
&gt; Hello,<br>
&gt;<br>
&gt; far away from being a guru of anything but I looked through the code.<br>
&gt;<br>
&gt; Related to thie JBSEAM-3008 and the posting on<br>
&gt; <a href="http://seamframework.org/Documentation/TuningTheSeamWebsite" target="_blank">http://seamframework.org/Documentation/TuningTheSeamWebsite</a><br>
&gt;<br>
&gt; I evaluted JSF reference implementation 1.2.04<br>
&gt;<br>
&gt; A component extending from UIComponentBase has a number of JSF phase<br>
&gt; handler.<br>
&gt; processRestoreState<br>
&gt; processDecodes<br>
&gt; processValidators<br>
&gt; processUpdates<br>
&gt; processSaveState<br>
&gt;<br>
&gt; a get request is only calling processSaveState but a post request is calling<br>
&gt; everything<br>
&gt;<br>
&gt; The implementations are more or less iterating through the childs and<br>
&gt; calling the child handlers<br>
&gt;<br>
&gt; Three methods (<br>
&gt; processDecodes<br>
&gt; processValidators<br>
&gt; processUpdates<br>
&gt; ) are calling isRendered which in turn leads to an EL resolution.<br>
&gt;<br>
&gt; In totally isRendered is called at least 5 times before an element is<br>
&gt; rendered. Calls are not cached and the EL is evaluated every time.<br>
&gt; Calling methods are encodeChild,encodeBegin/encodeEnd/encodeChildren and a<br>
&gt; super class + 3 if the request is a post and the component extends<br>
&gt; UIComponentBase<br>
&gt;<br>
&gt; There are two consequences: one for a proper cache implementation and one<br>
&gt; for performance<br>
&gt;<br>
&gt; 1) cache<br>
&gt; To have a proper cache implementation our cache component needs to overwrite<br>
&gt; at least phase listener<br>
&gt; processDecodes<br>
&gt; processValidators<br>
&gt; processUpdates<br>
&gt; with an empty implementation. This will block all following updates as JSF<br>
&gt; is always running through the object tree. As a consequence the cached<br>
&gt; fragment should not be a form. The content will not be updated, even if it<br>
&gt; is not yet cached. processSaveState and processRestoreState should not be<br>
&gt; overwritten. It might be slightly inefficient but these methods fill the<br>
&gt; component tree we need to cache.<br>
&gt;<br>
&gt; Actually, I wanted to create a patch but where is the source for HtmlCache.<br>
&gt; It seams not to be in seam-trunk. Anyway, just overwrite the three methods<br>
&gt; and don&#39;t delegate to the parent class but leave it empty.<br>
&gt;<br>
&gt;<br>
&gt; 2) performance<br>
&gt; This is not related to the cache but a general JSF problem.<br>
&gt; In the class org.jboss.seam.ui.util.cdk.RendererBase add two lines to<br>
&gt; evaluate the rendered expression<br>
&gt; and call setRendered and set the result of the evaluation. This will reduce<br>
&gt; the calls for all components using this renderer to one call.<br>
&gt;<br>
&gt; It would reduce the rendered EL calls by 80 % . The question is, if we will<br>
&gt; see any side effects. &nbsp;If no components are doing funny things, it should<br>
&gt; work. I would propose that we carefully test this in different applications.<br>
&gt;<br>
&gt; public void renderChildren(FacesContext facesContext, UIComponent component)<br>
&gt; throws IOException {<br>
&gt; &nbsp; if (component.getChildCount() &gt; 0) {<br>
&gt; &nbsp; &nbsp; for (Iterator it = component.getChildren().iterator(); it.hasNext();) {<br>
&gt; &nbsp; &nbsp; &nbsp; UIComponent child = (UIComponent) it.next();<br>
&gt; // here the two lines<br>
&gt; &nbsp; &nbsp; &nbsp; boolean rendered = child.isRendered();<br>
&gt; &nbsp; &nbsp; &nbsp; child.setRendered(rendered);<br>
&gt; &nbsp; &nbsp; &nbsp; renderChild(facesContext, child);<br>
&gt; &nbsp; &nbsp; }<br>
&gt; &nbsp; }<br>
&gt;<br>
&gt;<br>
&gt; Best Regards<br>
&gt;<br>
&gt; Sebastian Hennebrueder<br>
&gt; ----<br>
&gt; <a href="http://www.laliluna.de" target="_blank">www.laliluna.de</a><br>
&gt; Training, Tutorials and Java Development<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; seam-dev mailing list<br>
&gt; <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
&gt;<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&#39;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&#39;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>