jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing is 7x slower when compared to js-yaml

iki opened this issue · comments

... and dumping is 11x faster to be honest :)

However, maybe the parsing speed could be improved.

Perf test results:

$ yaml-vs-json-perf.cmd write
json stringify 207ms
js-yaml stringify 13913ms
js-yaml safe stringify 14076ms
yamljs stringify 1213ms
yaml stringify # too long or fails, did't have patience to wait

$ yaml-vs-json-perf.cmd read
json parsing 187ms
js-yaml parsing 633ms
js-yaml safe parsing 716ms
yamljs parsing 4644ms
yaml parsing 5792ms

Yes, that's a known thing but I have no intention to try to improve parsing speed myself because one could always use js-yaml if performance is critical.

PR are welcome to improve this, but again, I would rather think it's a better idea to use yaml-js directly if it is already better at that task.