toml-node icon indicating copy to clipboard operation
toml-node copied to clipboard

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

Open felix9 opened this issue 6 years ago • 1 comments

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 avatar Sep 03 '17 19:09 felix9

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

felix9 avatar Sep 12 '17 16:09 felix9