Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 3 tasks
bd82 opened this issue Jan 25, 2019 · 1 comment
Open
1 of 3 tasks

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

bd82 opened this issue Jan 25, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@bd82
Copy link
Contributor

bd82 commented Jan 25, 2019

  • Evaluate performance advantages of not using the CST for this.
  • Evaluate performance advantages of using custom token patterns, could those be used
    to avoid post-processing?
    Possible use cases:
    - when lexing a date could we create the JS Date Object on the fly?
    - processing backslash line terminator in multiline strings
    - stripping strings delimiters
    - Numerical values conversion to Number during lexing.
  • Evaluate additional "fastest" API relevance (e.g only offset position tracking).
@bd82 bd82 added the enhancement New feature or request label Jan 25, 2019
@bd82
Copy link
Contributor Author

bd82 commented Jan 27, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant