472,955 Members | 2,616 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,955 software developers and data experts.

performance of XslTransform vs XslCompiledTransform

Hi,

From reading the documentation, I get the impression that
XslCompiledTransform should be faster than XslTransform

on my test with a large complex document and a large complex XSLT, the
transform took 4 minutes with XslTransform but 7 minutes with
XslCompiledTransform.

However, with the same stylesheet on another large complex document, the
time dropped from 4 minutes with XslTransform to just 45 seconds with
XslCompiledTransform.

any clues as to what might cause this difference in performance? is one of
my results exceptional?

this sort of process is typical in my application so I'd like to get the
best overall performance.

TIA

Andy
May 24 '07 #1
3 5386
Andy Fish wrote:
From reading the documentation, I get the impression that
XslCompiledTransform should be faster than XslTransform

on my test with a large complex document and a large complex XSLT, the
transform took 4 minutes with XslTransform but 7 minutes with
XslCompiledTransform.

However, with the same stylesheet on another large complex document, the
time dropped from 4 minutes with XslTransform to just 45 seconds with
XslCompiledTransform.

any clues as to what might cause this difference in performance? is one of
my results exceptional?
When you call the Load method then XslCompiledTransform compiles the
XSLT stylesheet to MSIL. That often takes longer than loading with
XslTransform. On the other hand executing the Transform method, in
particular several times with a compiled stylesheet, should perform much
better with XslCompiledTransform.
See <http://blogs.msdn.com/antosha/archive/2006/07/24/677560.aspxfor
some detailed comparison.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
May 24 '07 #2
"Martin Honnen" <ma*******@yahoo.dewrote in message
news:eT*************@TK2MSFTNGP05.phx.gbl...
Andy Fish wrote:
>From reading the documentation, I get the impression that
XslCompiledTransform should be faster than XslTransform

on my test with a large complex document and a large complex XSLT, the
transform took 4 minutes with XslTransform but 7 minutes with
XslCompiledTransform.

However, with the same stylesheet on another large complex document, the
time dropped from 4 minutes with XslTransform to just 45 seconds with
XslCompiledTransform.

any clues as to what might cause this difference in performance? is one
of my results exceptional?

When you call the Load method then XslCompiledTransform compiles the XSLT
stylesheet to MSIL. That often takes longer than loading with
XslTransform. On the other hand executing the Transform method, in
particular several times with a compiled stylesheet, should perform much
better with XslCompiledTransform.
See <http://blogs.msdn.com/antosha/archive/2006/07/24/677560.aspxfor
some detailed comparison.
Thanks for the quick response Martin. I have tried running the same compiled
transformation against the document twice and it was not appreciably quicker
the second time.

I had seen your link and several other related articles and noticed that
they usually put their timings in milliseconds whereas mine are in minutes
(!!), so I wasn't expecting the JIT overhead to be that significant. note
that smaller documents run in a couple of seconds with the same transform.

Andy
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

May 24 '07 #3
Hello Andy,

The best way to report a bug or a performance issue in System.Xml is to file
it at http://connect.microsoft.com/ and attach simplified repro files. If you
have any issues with Microsoft Connect site, you may send repro files to me
(my email is here: http://antosha.com/workemail.gif), and I will file it for
you.

Thank you for your feedback!
-Anton Lapounov

May 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cody | last post by:
Iam using Beta2 of VS2005 and got this strange message: Warning 1 'System.Xml.Xsl.XslTransform' is obsolete: 'This class has been deprecated. Please use System.Xml.Xsl.XslCompiledTransform...
1
by: George Durzi | last post by:
Folks, I'm running into some performance issues with my Xsl transformations. I've done a ton of debugging and digging around, and have come to the conclusion that the performance issues are NOT...
3
by: Eckhard Schwabe | last post by:
when switching from the old "XslTransform " to "XslCompiledTransform" I notice a difference in the handling of whitespace. I need to transform a XML file which contain tabs (\t), and which remain...
0
by: Matt | last post by:
With VS2005 I see that the XslTransform class has been deprecated and XslCompiledTransform has replaced it. I am having issues with trying to get the new class to work how it did with the old. I...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
1
by: Praveen | last post by:
Have a common function in Javascript which do transform for all .xsl's. XSL object is loaded like this. var xslobj=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.4.0"); xslobj.async = false;...
2
by: steve.nickels | last post by:
Hello. I'm in the midst of moving a web application from ASP.NET 1.1 to ASP.NET 2.0 (framework 3.0), and as part of this move, I am told by Visual Studio that the XslTransform object is now...
9
by: WT | last post by:
Hello, I have code created with .net 1.0 and migrated to 3.5. Form 2.0 the XslTransform class is obsolete and the vs2008 compiler generates warnings that these classes are absolete suggesting to...
0
by: bryhi | last post by:
Here is the code you can past in your console application to see the differences. I need to know how to get this to work correctly. #pragma warning disable // because we are using a depricated...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.