[
https://issues.apache.org/jira/browse/TAP5-1537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Howard M. Lewis Ship closed TAP5-1537.
--------------------------------------
Resolution: Invalid
The new approach in 5.4 is much "lighter" (just a single global event handler
for all zones on the page) and should address your performance concerns.
> Improve js processing time for pages with huge number of zones
> --------------------------------------------------------------
>
> Key: TAP5-1537
> URL: https://issues.apache.org/jira/browse/TAP5-1537
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.2
> Reporter: Pedro Ayala
> Labels: ajax,, javascript,, performance, zone,
> Attachments: tapestry-zone-improvement.txt
>
>
> When creating a new page with a huge number of zones we are initializing all
> them in javascript calling Tapestry.ZoneManager.initialize. This is not
> affecting modern browser, but for some old browser like internet explorer 6
> or 7, this method can take a long time to be executed.
> In order to prevent this overhead in the javascript load in the user browser,
> we can lazily create the zoneManager object when it is needed. For doing this
> we should only create the js zone object when there is some special parameter
> for creating it. The only time we need to create the zone in load time, is
> when we have some special setup for creating the zone.
> The zone can be created when calling findZoneManagerForZone. If it fails to
> find the zone, we can try to create it, and only if it fails we will fire the
> error message.
> Once the zone has been lazily created, findZoneManagerForZone it will find
> the zone following the normal behaviour.
> ### Eclipse Workspace Patch 1.0
> #P tapestry-core
> Index: src/main/resources/org/apache/tapestry5/tapestry.js
> ===================================================================
> --- src/main/resources/org/apache/tapestry5/tapestry.js (revision
> 1129658)
> +++ src/main/resources/org/apache/tapestry5/tapestry.js (working copy)
> @@ -492,6 +492,9 @@
> var manager = $T(element).zoneManager;
>
> if (!manager) {
> + var mgr = new
> Tapestry.ZoneManager({"element":zoneElement});
> + if (mgr)
> + return mgr;
> Tapestry.error(Tapestry.Messages.noZoneManager,
> element);
> return null;
> }
> @@ -1233,7 +1236,8 @@
> },
>
> zone : function(spec) {
> - new Tapestry.ZoneManager(spec);
> + if (spec.show || spec.parameters ||
> (spec.update && spec.update != 'show') )
> + new Tapestry.ZoneManager(spec);
> },
>
> formFragment : function(spec) {
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira