.NETGURU
Performance of .NET XSL Transformation
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngxml' list.


Denis Levin
Hi, everybody.
Has anyone tested performance of .NET XSL transformation? Are there any
performance results and optimization tips available for .NET classes
(XmlDataDocument, XslTransform)?

My performance comparison tests of .NET vs. MSXML4 show that .NET is from 2
to 20 times slower on the same source files (though it is difficult to come
up with identical tests). Only XPathDocument performs reasonably well is
passed as a parameter for XSL transformation, XmlDataDocument is very slow.

Thanks a lot!

- Denis.

P.S. Here are my results:
1)
Test data: dataset 22192 rows by 25 cols, some NULLs.
Output file size: 10.5 mb
MSXML4 XSL Processor with DOM passed as a parameter: 6.26 sec.
.NET XslTransform with XmlDataDocument passes as a parameter: 107 sec.

MSXML4 XSL Processor Transformation against Master XML: 7.42 sec.
.NET XslTransform with XmlDataDocument as master XML: 167 sec.

MSXML4 XMLDOM transformation: 11 sec.

.NET Simple transformation, XmlDataDocument to memory stream: 339 sec.
.NET XPathDocument passed as a parameter: 20.1 sec.
.NET Simple transformation, file to file (uses XPathDocument internally): 22
sec.

2)
Test data: dataset 2155 rows by 7 cols, no NULLs.
Output file Size: 363K

MSXML4 XSL Processor with DOM passed as a parameter: 0.36 sec.
.NET XslTransform with XmlDataDocument passes as a parameter: 7.1 sec.

MSXML4 XSL Processor Transformation against Master XML: 0.39 sec.
.NET XslTransform with XmlDataDocument as master XML: 7.7 sec.

MSXML4 XMLDOM transformation: 0.47 sec.

.NET Simple transformation, XmlDataDocument to memory stream: 6.7 sec.
.NET XPathDocument passed as a parameter: 0.7 sec.
.NET Simple transformation, file to file (uses XPathDocument internally):
0.67 sec.

----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:fo="http://www.w3.org/1999/XSL/Format";
    xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:param name="My">DefValue</xsl:param>
<xsl:param name="data"/>

<xsl:template match="/">
<fo:root>
<Greeting>
    Hello, <xsl:value-of select="$My"/>!
</Greeting>
<SAText> Below is your data:</SAText>
    <SATable>
        <xsl:for-each
select="msxsl:node-set($data)/NewDataSet/Table">
        <SARow>
            <xsl:for-each select="*">
                <SACell>
                    <xsl:value-of select="."/>
                </SACell>
            </xsl:for-each>
        </SARow>
        </xsl:for-each>
    </SATable>
</fo:root>
</xsl:template>
</xsl:stylesheet>

Reply to this message...
 
    
Dan Wahlin
You're tests tell a true story. Microsoft published a Knowledge Base
article on the speed of XSLT transformations in .NET here:

http://www.kbalertz.com/redir.aspx?kbNumber=Q317691

XPathDocument will certainly perform better as it represents a
non-editable DOM that is optimized for XSLT transformations.

Dan Wahlin

Wahlin Consulting LLC
Microsoft MVP - ASP.NET
http://www.XMLforASP.NET
XML for ASP.NET Developers by Dan Wahlin in bookstores everywhere!

-----Original Message-----
From: Denis Levin [mailto:Click here to reveal e-mail address]
Sent: Wednesday, June 19, 2002 9:17 AM
To: aspngxml
Subject: [aspngxml] Performance of .NET XSL Transformation

Hi, everybody.
Has anyone tested performance of .NET XSL transformation? Are there any
performance results and optimization tips available for .NET classes
(XmlDataDocument, XslTransform)?

My performance comparison tests of .NET vs. MSXML4 show that .NET is
from 2
to 20 times slower on the same source files (though it is difficult to
come
up with identical tests). Only XPathDocument performs reasonably well is
passed as a parameter for XSL transformation, XmlDataDocument is very
slow.

Thanks a lot!

- Denis.

P.S. Here are my results:
1)
Test data: dataset 22192 rows by 25 cols, some NULLs.
Output file size: 10.5 mb
MSXML4 XSL Processor with DOM passed as a parameter: 6.26 sec.
.NET XslTransform with XmlDataDocument passes as a parameter: 107 sec.

MSXML4 XSL Processor Transformation against Master XML: 7.42 sec.
.NET XslTransform with XmlDataDocument as master XML: 167 sec.

MSXML4 XMLDOM transformation: 11 sec.

.NET Simple transformation, XmlDataDocument to memory stream: 339 sec.
.NET XPathDocument passed as a parameter: 20.1 sec.
.NET Simple transformation, file to file (uses XPathDocument
internally): 22
sec.

2)
Test data: dataset 2155 rows by 7 cols, no NULLs.
Output file Size: 363K

MSXML4 XSL Processor with DOM passed as a parameter: 0.36 sec.
.NET XslTransform with XmlDataDocument passes as a parameter: 7.1 sec.

MSXML4 XSL Processor Transformation against Master XML: 0.39 sec.
.NET XslTransform with XmlDataDocument as master XML: 7.7 sec.

MSXML4 XMLDOM transformation: 0.47 sec.

.NET Simple transformation, XmlDataDocument to memory stream: 6.7 sec.
.NET XPathDocument passed as a parameter: 0.7 sec.
.NET Simple transformation, file to file (uses XPathDocument
internally):
0.67 sec.

----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:fo="http://www.w3.org/1999/XSL/Format";
    xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:param name="My">DefValue</xsl:param>
<xsl:param name="data"/>

<xsl:template match="/">
<fo:root>
<Greeting>
    Hello, <xsl:value-of select="$My"/>!
</Greeting>
<SAText> Below is your data:</SAText>
    <SATable>
        <xsl:for-each
select="msxsl:node-set($data)/NewDataSet/Table">
        <SARow>
            <xsl:for-each select="*">
                <SACell>
                    <xsl:value-of select="."/>
                </SACell>
            </xsl:for-each>
        </SARow>
        </xsl:for-each>
    </SATable>
</fo:root>
</xsl:template>
</xsl:stylesheet>

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 06/13/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 06/13/2002

Reply to this message...
 
    
Rangi Keen
I attended one of the System.Xml talks given by Fadi Fakhouri (WebData XML
Team Project Manager at Microsoft) at this year's TechEd conference. He made
a note of the fact that System.Xml is currently slower than MSXML4 (for XSL
transformations only) because they didn't have time to do the optimizations
prior to the .NET ship. If performance is an issue, you will need to use
XPathDocument or MSXML4.

For more information see the TechEd 2002 site: http://www.mymsevents.com/
(navigate to TechEd 2002 -> Sessions and search for WEB301). You can view
the session slidedeck using this URL:
http://www.mymsevents.com/MyMSEvents/attachment.aspx?a=18" target="_blank">http://www.mymsevents.com/MyMSEvents/attachment.aspx?a=18\259\WEB301.ppt.

-----Original Message-----
From:     Denis Levin [mailto:Click here to reveal e-mail address]
Sent:    Wednesday, 19 June, 2002 12:17 PM
To:    aspngxml
Subject:    [aspngxml] Performance of .NET XSL Transformation

Hi, everybody.
Has anyone tested performance of .NET XSL transformation? Are there any
performance results and optimization tips available for .NET classes
(XmlDataDocument, XslTransform)?

My performance comparison tests of .NET vs. MSXML4 show that .NET is from 2
to 20 times slower on the same source files (though it is difficult to come
up with identical tests). Only XPathDocument performs reasonably well is
passed as a parameter for XSL transformation, XmlDataDocument is very slow.

Thanks a lot!

- Denis.

P.S. Here are my results:
1)
Test data: dataset 22192 rows by 25 cols, some NULLs.
Output file size: 10.5 mb
MSXML4 XSL Processor with DOM passed as a parameter: 6.26 sec.
.NET XslTransform with XmlDataDocument passes as a parameter: 107 sec.

MSXML4 XSL Processor Transformation against Master XML: 7.42 sec.
.NET XslTransform with XmlDataDocument as master XML: 167 sec.

MSXML4 XMLDOM transformation: 11 sec.

.NET Simple transformation, XmlDataDocument to memory stream: 339 sec.
.NET XPathDocument passed as a parameter: 20.1 sec.
.NET Simple transformation, file to file (uses XPathDocument internally): 22
sec.

2)
Test data: dataset 2155 rows by 7 cols, no NULLs.
Output file Size: 363K

MSXML4 XSL Processor with DOM passed as a parameter: 0.36 sec.
.NET XslTransform with XmlDataDocument passes as a parameter: 7.1 sec.

MSXML4 XSL Processor Transformation against Master XML: 0.39 sec.
.NET XslTransform with XmlDataDocument as master XML: 7.7 sec.

MSXML4 XMLDOM transformation: 0.47 sec.

.NET Simple transformation, XmlDataDocument to memory stream: 6.7 sec.
.NET XPathDocument passed as a parameter: 0.7 sec.
.NET Simple transformation, file to file (uses XPathDocument internally):
0.67 sec.

----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:fo="http://www.w3.org/1999/XSL/Format";
    xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:param name="My">DefValue</xsl:param>
<xsl:param name="data"/>

<xsl:template match="/">
<fo:root>
<Greeting>
    Hello, <xsl:value-of select="$My"/>!
</Greeting>
<SAText> Below is your data:</SAText>
    <SATable>
        <xsl:for-each
select="msxsl:node-set($data)/NewDataSet/Table">
        <SARow>
            <xsl:for-each select="*">
                <SACell>
                    <xsl:value-of select="."/>
                </SACell>
            </xsl:for-each>
        </SARow>
        </xsl:for-each>
    </SATable>
</fo:root>
</xsl:template>
</xsl:stylesheet>

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Xml.XmlDataDocument
System.Xml.XPath.XPathDocument
System.Xml.Xsl.XslTransform




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification