Replacing std.xml

qznc qznc at web.de
Mon Sep 2 06:34:18 PDT 2013


On Saturday, 31 August 2013 at 18:53:42 UTC, Michel Fortin wrote:
> On 2013-08-31 15:43:00 +0000, "ilya-stromberg" 
> <ilya-stromberg-2009 at yandex.ru> said:
>
>> On Thursday, 29 August 2013 at 07:53:46 UTC, Tobias Pankrath 
>> wrote:
>>> There is http://dsource.org/projects/xmlp, which at some 
>>> point has been proposed for std.xml2. But that stalled for 
>>> some time now.
>> 
>> Also, we have Tango Xml:
>> https://github.com/SiegeLord/Tango-D2/tree/d2port/tango/text/xml
>> 
>> It's the fastest Xml parser in the world, so may be you can 
>> find it useful:
>> dotnot.org/blog/archives/2008/03/10/xml-benchmarks-parsequerymutateserialize/
>> dotnot.org/blog/archives/2008/03/12/why-is-dtango-so-fast-at-parsing-xml/
>
> Someone should benchmark it against the XML implementation I 
> made. It has many of the same characteristics.
>
> For instance, Tango's SaxParser is based on its PullParser. 
> This design requires the use a dynamic array to maintain a 
> stack of opened elements. While not a huge performance hit, you 
> don't need that if you use recursion, which you can do with my 
> implementation. You can do that even though you can also use it 
> as a pull tokenizer[^1] when needed (recursion is optional on a 
> token-by-token basis).

Recursion means you use the call stack instead of stack object on 
the heap.

Be careful about nesting deepness. There are XML documents out 
there with thousands and more nested elements. With recursion on 
a 32bit machine you might get a stack overflow, but a heap-stack 
could handle a million nested elements.


More information about the Digitalmars-d mailing list