.NETGURU
What makes VB.Net XslTransform REALLY REALLY SLOW?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.performance.

Post a new message to this list...

Lenonardo
HI.

I've just started working with VB.Net to put a wrapper around an XML
processing application.

This application bascially presents a user with an iterative loop of
- load XML
- Transform for display to user
- collect user amendments to XML
- update XML
and round we go again.

I am using XSLT stylesheets for most of the processing.
I have used these stylesheets for a couple of years - and have tested and
tuned them against several XSLT Processors (msxsl, xalan, saxon, xsltproc,
sablotron) as they are processing data matrices and have to do lots of for-
each looping and accessing nodes by keys.

I have found that the .Net XslTransform class is UNBELIEVEABLY SLOW at this
processing.
E.g. 250kB XML document takes < 1second for main XSLT using ALL the other
processors.
The time taken in .Net is SEVERAL MINUTES!

Can anyone give me any idea of what could be causing this?
I have played around using intermediate XPathDocuments, various types of
Read/Write streams (even saving the whole lot to a disc file each time
around the loop!) - and nothing seems to make any difference.

(I have currently switched to loading MSXML2 into the application and am
using that for transformations - and things are working in the sub 1 second
timings I would expect.)

Reply to this message...
 
    
Sahil Malik
All I know is, that it is being sped up by almost 400% in framework 2.0. I'd
venture to guess that the transform engine in .NET is not well written
maybe?

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/

"Lenonardo" <Click here to reveal e-mail address> wrote in message
news:Xns95016847E3411M3141T@207.46.248.16...
[Original message clipped]

Reply to this message...
 
    
Lenonardo
That's interesting - and I have found several references to the fact
that the .Net Transform code was rushed - and did not include many
optimisations built into MSXML - particularly if <xsl:key... is used.

But I'd be looking for a speed improvement of 10,000% to make it at all
useable for my sorts of XML - and if MSXML can do it - why not .Net?

"Sahil Malik" <Click here to reveal e-mail address> wrote in
news:Click here to reveal e-mail address:

[Original message clipped]

Reply to this message...
 
    
Anders Borum
The current .NET implementation is quite slow when it comes to certain
situations with heavy dependency on the xsl:key function. There should be
some information on this on the net (try google).

The xsl:key function should improve beyond the 400% mentioned.

--
venlig hilsen / with regards
anders borum
--

Reply to this message...
 
    
Lenonardo
"Anders Borum" <Click here to reveal e-mail address> wrote in news:OAfR7PeUEHA.2716
@tk2msftngp13.phx.gbl:

[Original message clipped]

Thanks - I cam across the xsl:key references on google.
They just said 'it is slow' (but not 'it's unuseably slow').

I've tried with and without keys, tried restructuring the XML into
different hierarchies etc.

My main conclusion is that .Net XSLT is OK if you just want to move to the
next/previous/child/parent (i.e. reading databases)- but is slow beyond
your wildest dreams for anything else.

I've just switched all my code to using MSXML2 and it is over 100 times
faster for almost everything.
The only thing I am using .Net for is reading a large XML file (37mB) and
breaking it into smaller ones.
Reply to this message...
 
    
Anders Borum
Hello!

I agree with the speed of the current XsltTransform class. But as I said,
the .NET developers are looking into this and will hopefully (eventually)
match the speed of MSXML 4.0 (which has become legendary for its speed).

Look at it this way - if you need the speed now, it's not that bad - for for
the rest of us, who can live with the current speed, we're in for a serious
treat.

I never believed that .NETs XslTransform class woul be as fast as the MSXML
4.0, before .NET version 2.0 (or the version after that). Let's keep our
fingers crossed.

--
venlig hilsen / with regards
anders borum
--

Reply to this message...
 
    
Lenonardo
"Anders Borum" <Click here to reveal e-mail address> wrote in news:#cYN0v7WEHA.3944
@tk2msftngp13.phx.gbl:

[Original message clipped]

I investigated the .NET Xpath and XSLT and I think it is OK for simple
reformatting of database rows, or stepping sequentially through an XML Tree
- or maybe more precisely for SAX type streaming - but absolutely useless
for anything where the input XML structure is different from the output
structure.

I'm now using MSXML2 inside my app - and it is about 100 times faster than
..Net.

The bits that amazed me were that the two key features of XSLT (for me
anyway) - keys and Xpath - were the ones that were really badly
implemented.
Reply to this message...
 
 
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