19 ms·
Interesting to see, just took handmade xml parser as a personal challenge, in python though, I've been hitting nasty performance issues compared to libxml2.
by agumonkey 11y ago
Interesting to see, just took handmade xml parser as a personal challenge, in python though, I've been hitting nasty performance issues compared to libxml2.
- Mikhail_Edoshin 11y agoBasic XML parsing should be very simple, it's deterministic with one-symbol lookahead. There's a number of small C parsers out there and even one written in assembly. If you want to validate it though or parse DTDs, that's a different story.
- agumonkey 11y agoIndeed that's why I was surprised to be 200x slower than libxml2. A lesson in performance.
- khedoros 11y agoAny idea what the cause of the bottleneck is?
- gsnedders 11y agoDTDs really are the thing that should never have been in XML. Namespaces in XML make them pretty useless, given they only have a concept of QNames and not namespace URL & local name tuples, and they don't compose in any sensible way. They are such a large part of the complexity of the XML it's just sad.