[xsl] xsl:import performance problems

Subject: [xsl] xsl:import performance problems
From: Ronan Klyne <ronan.klyne@xxxxxxxxxxx>
Date: Tue, 29 Jan 2008 16:01:07 +0000
Hello all,

I have recently found that a particular pattern of imports causes my stylesheet to take a very long time to compile. I really wasn't expecting this to happen, and now I hope that someone can explain to me what is happening...

I have a set of 20 xsl files, with an extra 'master' xsl file which imports the other files. This works and performs well.

I ran into problems when I changed this arrangement. In an attempt to break up the set of files so that I could re-use small parts of them elsewhere, I added an import statement to each file so that each imported the files it depended upon. This works out at an average of 3 imports per file, with one particular file being imported in almost every other.

When I did this, it went from taking 2 seconds to compile to 20 seconds (measured using Saxon's -t switch).
I can't for the life of me work out why this change would cause such a drastic slowdown. Does anyone have any thoughts or advice on the matter?

I am using Saxon 6 on Java 1.6, btw.


Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518

Current Thread