Re:YAML: probably not so great after all (2017)
by gpoore on Thursday June 21, 2018 @04:01PM
(#17368761)
I suspect the speed issues are more a result of implementation details than of being in Python. Last year, I created a config language for my own use that supports some syntax very similar to YAML. My pure Python library can load simple dict/list/string data 10x as fast as PyYAML, and nearly within 1.5x the speed of libyaml (https://bespon.org/#benchmarks). That's while building an AST with source information to allow round-tripping and supporting my own version of anchors and tags, so there's significant room for improvement. I expect that a pure Python YAML library might be able to match or beat the current performance of libyaml in at least some cases, particularly for a restricted subset of YAML.
Re:YAML: probably not so great after all (2017)
by jgalt212 on Saturday June 23, 2018 @01:24PM
(#17382266)
I did a few rudimentary benchmarking tests on in house real world data sets and strictyaml was approx 10X slower than PyYAML's yaml.load (w/ out calling out to libyaml) and yaml.safe_load.
I used the basic strictyaml.load function, without any schemas.
README page said speed is not a current priority, and that appears to be true.
I have not yet taken a look at strictyaml, but after years of use the spec definitely needs YAML, The Good Parts Treatment.
One thing the author did not mention was how slow the out of box the Python YAML parser can be. This can be sped up with a call to libyaml, but then you lose the safe_load method.