performance of XslTransform vs XslCompiledTransform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy Fish

    performance of XslTransform vs XslCompiledTransform

    Hi,

    From reading the documentation, I get the impression that
    XslCompiledTran sform 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
    XslCompiledTran sform.

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

    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


  • Martin Honnen

    #2
    Re: performance of XslTransform vs XslCompiledTran sform

    Andy Fish wrote:
    From reading the documentation, I get the impression that
    XslCompiledTran sform 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
    XslCompiledTran sform.
    >
    However, with the same stylesheet on another large complex document, the
    time dropped from 4 minutes with XslTransform to just 45 seconds with
    XslCompiledTran sform.
    >
    any clues as to what might cause this difference in performance? is one of
    my results exceptional?
    When you call the Load method then XslCompiledTran sform 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 XslCompiledTran sform.
    See <http://blogs.msdn.com/antosha/archive/2006/07/24/677560.aspxfor
    some detailed comparison.
    --

    Martin Honnen --- MVP XML

    Comment

    • Andy Fish

      #3
      Re: performance of XslTransform vs XslCompiledTran sform

      "Martin Honnen" <mahotrash@yaho o.dewrote in message
      news:eT7EwOhnHH A.208@TK2MSFTNG P05.phx.gbl...
      Andy Fish wrote:
      >
      >From reading the documentation, I get the impression that
      >XslCompiledTra nsform 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
      >XslCompiledTra nsform.
      >>
      >However, with the same stylesheet on another large complex document, the
      >time dropped from 4 minutes with XslTransform to just 45 seconds with
      >XslCompiledTra nsform.
      >>
      >any clues as to what might cause this difference in performance? is one
      >of my results exceptional?
      >
      When you call the Load method then XslCompiledTran sform 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 XslCompiledTran sform.
      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/

      Comment

      • =?Utf-8?B?QW50b24gTGFwb3Vub3Y=?=

        #4
        Re: performance of XslTransform vs XslCompiledTran sform

        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

        Comment

        Working...