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

use offset() instead of line()/column() for issue #39 #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

felix9
Copy link
Contributor

@felix9 felix9 commented Sep 3, 2017

This makes toml.parse about 2x faster for typical inputs.

Computing line() and column() for every node is expensive, and the information is only needed for error messages. offset() is much cheaper, and it's easy to compute line/column from the offset when we need them.

I'm leaving all the uses of line/column in toml.pegjs for now, because removing them will conflict with pr #44 . I'll fix it up after that one is resolved (either yes or no).

@felix9 felix9 mentioned this pull request Sep 3, 2017
@felix9
Copy link
Contributor Author

felix9 commented Sep 12, 2017

Hi, @BinaryMuse, do you have time to look at this?

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

Successfully merging this pull request may close these issues.

1 participant