Delphi 可用的最快的 XML 解析器是什么? [英] What is the fastest XML Parser available for Delphi?

查看:33
本文介绍了Delphi 可用的最快的 XML 解析器是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前使用 MSXML2 解析了相当大的 XML 字符串

We have reasonably large XML strings which we currently parse using MSXML2

我刚刚尝试使用 MSXML6,希望能提高速度,但一无所获!

I have just tried using MSXML6 hoping for a speed improvement and have got nothing!

我们目前创建了很多 DOM 文档,我猜在不断与 MSXML2/6 dll 交互时可能会有一些开销

We currently create a lot of DOM Documents and I guess there may be some overhead in constantly interacting with the MSXML2/6 dll

有人知道更好/更快的 Delphi XML 组件吗?

Does anyone know of a better/faster XML component for Delphi?

如果有人可以提出替代方案,并且速度更快,我们会考虑将其集成,但这将是大量工作,因此希望结构与 MSXML 使用的结构不会有太大不同

If anyone can suggest an alternative, and it is faster, we would look to integrate it, but that would be a lot of work, so hopefully the structure would not be too different to that used by MSXML

我们使用的是 Delphi 2010

We are using Delphi 2010

保罗

推荐答案

最近我遇到了一个类似的问题,使用 MSXML DOM 解析器被证明对于给定的任务来说太慢了.我不得不解析大于 1MB 的相当大的文档,并且 DOM 解析器的内存消耗令人望而却步.我的解决方案是根本不使用 DOM 解析器,而是使用事件驱动的 MSXML SAX 解析器.事实证明,这要快得多.不幸的是,编程模型完全不同,但取决于任务,它可能是值得的.Craig Murphy 发表了一篇关于如何在 delphi 中使用 MSXML SAX 解析器的优秀文章:SAX、Delphi 和 Ex Em El

Recently I had a similar issue where using the MSXML DOM parser proved to be too slow for the given task. I had to parse rather large documents > 1MB and the memory consumption of the DOM parser was prohibitive. My solution was to not use a DOM parser at all, but to go with the event driven MSXML SAX parser. This proved to be much, much faster. Unfortunately the programming model is totally different, but dependent on the task, it might be worth it. Craig Murphy has published an excellent article on how to use the MSXML SAX parser in delphi: SAX, Delphi and Ex Em El

这篇关于Delphi 可用的最快的 XML 解析器是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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