I have a complicated rules.xml - more than 600 lines - for now I have partly seperated it in several xml-Files (~ 20 xi-includes).
<rules css:if-content="body.template-A>
<xi:include="template-a.xml">
</rules>
But this is very slow to render > 15sec on page request.
How can I speed up transformation? Merging all in the rules.xml is a solution, but not the preferred...
Thanks in advance.
Products.LongRequestLogger is good for finding requests that take too long, it is usually the wrong tool to figure out why a certain response is slow.
Here is what you should do:
1) Set up some performance tests with jmeter (or any other performance measurement tool) for your page:
https://plone-performance-testing.readthedocs.org/en/latest/jmeter/getting-started-with-jmeter.html
Since you already know which pages take too long to render, it might be sufficient to just write a performance test for a single page. Having tests for the different kind of pages will give you a better idea why things are slow though.
2) Run the performance tests and play around with the Diazo rules. Remove them entirely and then add parts step by step (with and without xincludes). This will show you where the rules are slow. Make sure you save the performance test results for each step to be able to compare.
3) Confirm that xincludes are the problem (or not). If this is really the case, I guess there is not much you can do about it, instead of avoiding xincludes. Though, it is hard to imagine that this is really the problem. I'm using xinclude in basically all my larger projects, where we run performance tests on a regular basis. I never saw any performance issues with it.