You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tobias Wehrum <Le...@dragonlab.de> on 2008/04/15 12:51:32 UTC
T5: Calling functions at page template (in a grid) costs very much
time
Sorry, I forgot: Tapestry 5.
Tobias Wehrum schrieb:
> Hello,
>
> in my template, I'm using a grid similar to this simplified model:
>
> <t:grid source="gridObjects" row="currentGridObject" model="gridModel">
> <t:parameter name="someCell">
> ${someFunctionGeneratingSomething}
> </t:parameter> </t:grid>
>
> When i comment out the parameter block, it is significantly faster
> compared to when getSomeFunctionGeneratingSomething() is called. (When
> it costs 2 seconds to show 4 gridObjects without someCell, it will
> cost 4 seconds with it.)
> At first I thought the database calls in
> getSomeFunctionGeneratingSomething() are consuming the time, but then
> I replaced it with a simple "return 0;" - and still it consumes almost
> 4 seconds, the difference was minimal.
>
> I "solved" the problem by constructing a class dedicated to presentate
> my gridObjects (simply wrapping them, so that all properties are
> copied and a property does what getSomeFunctionGeneratingSomething
> would be doing). That works, but it would be quite a bother to
> construct this for all classes I want to output; it would nearly
> double my work with them, not to mention the maintainability.
>
> Why is this so time intensive? Is there any better way to solve this?
>
> Thanks,
> Tobias
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org