XslCompiledTransform 的最快内存缓存 [英] fastest in-memory cache for XslCompiledTransform

查看:37
本文介绍了XslCompiledTransform 的最快内存缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组 xslt 样式表文件.我需要产生 XslConpiledTransform 的最快性能,所以我想在内存中表示这些样式表.

I have a set of xslt stylesheet files. I need to produce the fastest performance of XslConpiledTransform, so i want to make in-memory representation of these stylesheets.

我可以在应用程序启动时将它们作为 IXpathNavigable 加载到内存中集合,然后在每个请求上将每个 IXPAthNavigable 加载到单例 XslCompiledTransform 中.但这仅适用于没有 xsl:import 或 xsl:include 的 styleshhets.(Xsl:import 仅用于文件).

I can load them to in-memory collection as IXpathNavigable on application start, and then load each IXPAthNavigable into singleton XslCompiledTransform on each request. But this works only for styleshhets without xsl:import or xsl:include. (Xsl:import is only for files).

我还可以将每个模板的 XSLCompiledTransform 的许多实例加载到缓存中.合理吗?

also i can load into cache many instances of XSLCompiledTransform for each template. Is it reasonable?

还有其他方法吗?哪个最好?提高 MS Xslt 处理器性能的其他技巧是什么?

Are there other ways? What is the best? what are another tips for improving performance MS Xslt processor?

推荐答案

成功执行后 Load()XslCompiledTransform,可以缓存这个实例以达到更好的性能.

请记住 Load() 是一个非常昂贵的操作.

Do remember that Load() is a very expensive operation.

这篇关于XslCompiledTransform 的最快内存缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆