[ 
http://www.stripesframework.org/jira/browse/STS-302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Gunter closed STS-302.
--------------------------


> Layout renderer performance improvements & corrections
> ------------------------------------------------------
>
>                 Key: STS-302
>                 URL: http://www.stripesframework.org/jira/browse/STS-302
>             Project: Stripes
>          Issue Type: Improvement
>          Components: Tag Library
>    Affects Versions: Release 1.4.1
>            Reporter: Denis Ivaikin
>            Assignee: Ben Gunter
>             Fix For: Release 1.5
>
>
> net.sourceforge.stripes.tag.layout.LayoutRenderTag - doEndTag() does the 
> following:
> URL target = request.getSession().getServletContext().getResource(this.name);
> This forces servlet container to create the new session if none exists which 
> might be not desirable if the page does not uses sessions at all (page 
> session="false" directive). It's possible to get the servlet context through 
> the getPageContext().getServletContext().
> Another issue is the getResource() performance penalty, this method triggers 
> check if the file exists on the local file system, which is quite slow. Since 
> there are few layouts in the application, it's possible to use the Map 
> between the page name & URL.
> So, I've made a minor patch which allocates the static Map
> private static ConcurrentMap<String, URL> targetMap = new 
> ConcurrentHashMap<String, URL>();
> And uses it like this
> if (!targetMap.containsKey(this.name)) targetMap.put(this.name, 
> getPageContext().getServletContext().getResource(this.name));
> URL target = targetMap.get(this.name);
> Which actually gives some performance benefit. However, some pages in the 
> application might be deleted in runtime, so, this method could give the false 
> positive. It could be possible to refresh the map periodically or use some 
> kind of listener.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to