[Setup] huge performance issues using Diazo

Laurence Rowe l at lrowe.co.uk
Thu Mar 29 11:29:16 UTC 2012


ctxlken wrote
> 
> Héctor,
> 
> I'm just curious - while the example below is for a condition that is 
> likely only checked once per page render, did you have some other 
> 'if-content' conditions that are checked more frequently?  Perhaps in 
> iterations, even, such as across all links in portal-globalnav, all <li> 
> tags within a navigation portlet, etc.?  I would think that if there is 
> some performance gain to be had from converting CSS3 to XPath selectors 
> at the outset (in the rules.xml) that if you're seeing such significant 
> performance gains it's more likely to be in rules that apply to many 
> links/portlets/items on a page, so that it's more of a compounded 
> problem/remedy.
> 
> I'm seeing some very, very large/long content pages in one of our 
> Diazo-themed sites producing some poor performance too, so thanks for 
> the tip below.  I'll be trying out XPath vs. CSS3 syntax to see whether 
> that helps in our case, or if it's just a matter of too much content 
> being pushed through the XSLT layer on a given page.  We get reasonable 
> (2 sec) page load times when viewing through an 'unthemed' URL (just has 
> Plone Sunburst theme applied w/o Diazo involvement), but getting 30-60 
> second page load times when viewing through the Diazo-applied-theme URL.
> 
> I'll report back if I can confirm that we see similar improvements from 
> converting the syntax to XPath.
> 

Conditions on a rules tag are just logically ANDed to the conditions on all
descendant rules, so they are executed multiple times per render (often
multiple times for every element on the page). The first thing to do is to
make your conditions more specific (testing a class currently requires
testing every otherwise matched element.)

To execute a condition once per render you must set it as a variable, e.g:



But this will not always result in a speedup. Unfortunately XSLT1 is a
little limited and can't directly refer to variables in  which are used for
drop/replace content and we have to get around this by dynamically
evaluating those expressions which can be slower than just executing the
condition multiple times.

There are a number of potential optimizations that could be applied
automatically in a future version of Diazo. As ever, contributing (with code
or sponsorship) is the way to make this happen sooner.

Laurence

--
View this message in context: http://plone.293351.n2.nabble.com/huge-performance-issues-using-Diazo-tp7372056p7417289.html
Sent from the Installation, Setup, Upgrades mailing list archive at Nabble.com.


More information about the Setup mailing list