4 ms·
> How many milliseconds does it take to parse YAML, XML, or any other file format for which a parser written in C is widely available? YAML and XML may be slow
by nknight 15y ago
> How many milliseconds does it take to parse YAML, XML, or any other file format for which a parser written in C is widely available?
YAML and XML may be slower than this, but Python 2.6's built-in 'json' module averages less than 20 milliseconds to parse a simple 1000-element "object"/dict on my system.
This isn't even the highest-performance JSON parser for Python, and parsing into less dynamic C or C++ datastructures would probably be somewhat faster still.
- qntm 15y agoJSON is a great data interchange format but I would veto it as an option for configuration files since it doesn't permit comments.
- nknight 15y agoActually it does, you just have to tilt your head right. :) See [1]. Either way, the principle stands. If a desktop environment wanted to standardize on JSON + C/C++-style comments, they could extend their standard parser easily enough without meaningful performance impact. [1] http://stackoverflow.com/questions/244777/can-i-comment-a-json-file/244858#244858 http://stackoverflow.com/questions/244777/can-i-comment-a-js...