Thursday, October 22, 2015

Fastest Xml Parser

A post on HN this morning states that an XML parser written in D is the fastest currently.

The explanation is that D uses a parser that does the following:

Pull parsing, where you can peek at the next value and then skip or consume it in one function call. For objects and arrays you pass a callback and continue processing in there. Fundamentally there is no document any more and processing is linear. On the other hand you get rid of dynamic types in statically typed languages like C++ or D and have the freedom to skip values you are not interested in. In particular it is faster to just validate a JSON number is correctly formatted than to convert it to a double. -Marco Leise

No comments: