Hi Laurence,<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
</div></div>Actually the whitespace bugfix in lxml I was referring to was something<br>
else. I've fixed this whitespace issue (and made a pull request to lxml) and<br>
released experimental.cssselect 0.3. Update your version pins.<br>
<br>
With this change I benchmarked the ploneorg theme with a<br>
css:if-content=".section-foo, .section-documentation" on the root rules<br>
element against a 20k and 565K documentation page. With the 20K document,<br>
execution time dropped to ~25ms from ~95ms. With the 565K document, the<br>
execution time dropped to ~1200ms and did not complete in several minutes<br>
with the previous version.<br>
<br>
Changing the condition to css:if-content="body.section-foo,<br>
body.section-documentation" dropped execution time for the 20K document to<br>
~7ms and for the 563K document to ~230ms using either the new or old<br>
experimental.cssselect.<br>
<br></blockquote><div class="h5"><br>A very noticeable gain! It might make sense to document this behavior somewhere, as this is against the conventional wisdom how CSS selectors work - they are evaluated from right to left and in a browser adding more specific selector might actually slow down things:<br>
<br><a href="https://twitter.com/#!/moo9000/status/181266290458116096">https://twitter.com/#!/moo9000/status/181266290458116096</a><br><br><a href="https://lists.plone.org/mailman/listinfo/plone-setup" target="_blank"> <br>
Mikko Ohtamaa<br></a><a href="http://opensourcehacker.com" target="_blank">http://opensourcehacker.com</a><br><a href="http://twitter.com/moo9000" target="_blank">http://twitter.com/moo9000</a><br><br>
<br><br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="HOEnZb"></div></blockquote></div>