un-ts / toml-tools

A set of tools for working with the Toml configuration file format.
MIT License
75 stars 10 forks source link

Compiler to Json package (@toml-tools/toml-to-json) #8

Open bd82 opened 5 years ago

bd82 commented 5 years ago
bd82 commented 5 years ago

Evaluate performance advantages of not using the CST for this.

Parsing seems 50-70% faster when not building the CST. So its likely ~50% performance boost could be gained by implementing a variant without CST creation.

The cost would be duplicating ~200 LOC (the parser itself) to insert the JSON building code into the parser flow. That duplication's alignment could be tested automatically by comparing the grammar AST structure. In addition the tests of the parser could be extracted to a separate dev package in this mono repo so we will avoid any duplication in the tests.