XslCompiledTransform 性能

XslCompiledTransform Performance: Beating MSXML 4.0
 
在 NET Framework 2.0 中, XslCompiledTransform  实现在 System.Data.SqlXml assembly 中 (为了减小Sysmtem.Xml 的大小)。缺省安装,System.Data.SqlXml assembly  没有被 NGen'd. 所以第一次使用时需要被JIT,需要很多时间。XSLT 在 Load 的时候被首先被编译成 MSIL 代码。然后在第一次运行时(Transform),MSIL代码被 JIT 成机器代码。所以每次 Load 的时候需要一些时间。 第一次Transform也需要一些时间。后续的XSLT执行(Transform)很快,因为他们已经是机器代码了。
 
关于几个Engine的实现:
MSXML 3.0. The native XSLT processor implemented in MSXML 3.0 is still used by default in the Internet Explorer 6.0 and 7.0. It compiled a stylesheet to a tree of "actions", each of which knew how to "execute" itself. So it worked as a pretty simple XSLT interpreter.
  • MSXML 4.0. The XSLT processor in MSXML 4.0 was completely reworked. It implemented a number of optimization techniques and compiled a stylesheet to some sort of P-code, which resulted in significantly faster transformation speed. This processor is more conformant and reliable than its MSXML 3.0 predecessor. Further versions of MSXML—5.0 and 6.0—bore the same XSLT processor as MSXML 4.0, so there is no much sense to consider them separately.
  • XslTransform. The first managed XSLT processor, XslTransform, was a port of MSXML 3.0 code. Unfortunately, in addition to bugs and performance issues ported from MSXML 3.0, some new ones were introduced during the porting process. XslTransform was good enough for many applications; however it was clear that its radical improvements were impossible without radical reworking of the code like the one happened between MSXML 3.0 and 4.0.
  • XslCompiledTransform. The .NET Framework 2.0 presents a new managed XSLT processor, XslCompiledTransform, which is going to replace the obsolete XslTransform class. XslCompiledTransform operates as a true compiler, translating a stylesheet into a set of dynamic MSIL methods, which use the highly-optimized XSLT runtime library. While compiled stylesheets run amazingly fast, incurred set-up costs—XSLT-to-MSIL compilation time plus JIT-compilation time—are considerably higher than for other XSLT processors, which may hinder its adoption in some applications.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值