[ 
https://issues.apache.org/jira/browse/TAP5-1206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1206:
---------------------------------------


Looking over the code there is a significant difference between the 5.1 
implementation and the 5.2.

In 5.1, the assets are re-resolved inside the setup render phase; that means on 
each render, the AssetSource is used to locate the Asset (localized).

In 5.2, the revised IncludeStylesheetWorker and its replacement, ImportWorker, 
are careful to resolve the Assets once, during the containingPageDidLoad() 
lifecycle method, which is equivalent to your sample code that injects the 
Asset.  I don't think you'll see the same performance issues in 5.2.

> @IncludeStylesheet slows down component rendering
> -------------------------------------------------
>
>                 Key: TAP5-1206
>                 URL: https://issues.apache.org/jira/browse/TAP5-1206
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Michael Wyraz
>
> We have a component (Button with it's own css) that is rendered multiple 
> times into a table (in some cases >3000 times). The css is included via 
> @IncludeStylesheet. Rendering 3000 of this buttons requires about 6-7 seconds 
> on server side. When I change the button code to:
>       @Inject
>       private RenderSupport renderSupport;
>       
>       @Inject
>       @Path("ActionButton.css")
>       private Asset stylesheet;
>       
>       @SetupRender
>       public void setup()
>       {
>               renderSupport.addStylesheetLink(stylesheet, null);
>       }
> (instead of @IncludeStylesheet) rendering happens in less than 1 second. So I 
> guess that the inserted code is very inefficient and should be replaced by 
> something like the code above.
> (whish) If you touch the code, please add a media attribute to the annotation 
> ;-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to