Memi.Reflection

Private members of memi's thoughts

XSL Transform performance

I came across few posts regarding the performance of XSL transformation in .NET 1.x, but only yesterday I came across a situation which made that quite clear.

We had an XML file of 1.2MB size, and a quite complicated XSL file (based on WordsheetML) to transform it.

Using the XslTransform object, it took about 10 secs.

Using MSXML4, including all the interop overhead, it took less than a second.

Is that reasonable? Are those the performance I should expect in the following scenarions? Did anybody find a good solution to this problem?

Comments

Oleg Tkachenko said:

Usual advices:
1. Use XPathDocument
2. Upgrade to latest .NET SP
3. Optimize your stylesheet - get rid of //, use keys etc.

And beware than using MSXML in .NET isn't supported by Microsoft.
# December 22, 2004 5:34 AM

Teemu Keiski said:

Check this out:

Improving .NET Application Performance and Scalability - Improving XML Performance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/ScaleNetChapt09.asp

See the section "XSLT Processing". It includes more dicussion about things Oleg already mentioned but also a few others to consider.
# December 22, 2004 9:47 AM

Jon Galloway said:

Glad you asked this question - I've been wondering the same thing. Interesting performance comparison article here:
http://www.ondotnet.com/pub/a/dotnet/2003/07/14/xsltperf.html

I think I'll stay with .NET and look at what Oleg and Teemu suggested.
# December 22, 2004 7:41 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)