What is the fastest XML Parser available for Delphi?

前端 未结 5 1647
梦谈多话
梦谈多话 2020-12-04 14:46

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

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

<
5条回答
  •  无人及你
    2020-12-04 15:21

    I know that it's an old question, but people might find it interesting:

    I wrote a new XML library for Delphi (OXml): http://www.kluug.net/oxml.php

    It features direct XML handling (read+write), SAX parser, DOM and a sequential DOM parser. One of the benefits is that OXml supports Delphi 6-Delphi XE5, FPC/Lazarus and C++Builder on all platforms (Win, MacOSX, Linux, iOS, Android).

    OXml DOM is record/pointer based and offers better performance than any other XML library:

    The read test returns the time the parser needs to read a custom XML DOM from a file (column "load") and to write node values to a constant dummy function (column "navigate"). The file is encoded in UTF-8 and it's size is about 5,6 MB.

    XML parse comparison

    The write test returns the time the parser needs to create a DOM (column "create") and write this DOM to a file (column "save"). The file is encoded in UTF-8 and it's size is about 11 MB.

    XML write comparison

    + The poor OmniXML (original) writing performance was the result of the fact that OmniXML didn't use buffering for writing. Thus writing to a TFileStream was very slow. I updated OmniXML and added buffering support. You can get the latest OmniXML code from the SVN.

提交回复
热议问题