OneGov/plonetheme.onegov — pull request #24 by ninfaj (2013-10-29 13:28:23+00:00)
Title: Diazo Transform is very slow on pages with many links

I've been puzzled by how slow the theme is on certain pages since and I've finally found the cause (though not yet the solution). I have a page that may contain a lot of links depending on the pagination.

Since using plonetheme.onegov the rendering time has gone up from 500ms to 3000ms. Turns out that the cause of this delay is the following part in the rules.xml:

5

C

*

*

"

`

Without it the theme transform is barely measurable. With it, the site slows to a crawl. I tried changing the selectors to xpath expressions - those are generally faster - but to no avail. As of yet I don't have a solution, but I didn't spend to much time investigating either.

It's probably necessary to not select on the links ('#document-action-pdf a'), but the ids alone ('#document-actions'). That will speed things up a lot. XSLT has the ability to copy the current node it selects and modify it (``) - so the a-element doesn't need to be selected directly.

To test create a plone page and add a couple of hundred links to it using copy paste in the html editor.