471,350 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 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 5299
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by cody | last post: by
1 post views Thread by George Durzi | last post: by
1 post views Thread by Praveen | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.