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

Tracking source locations in the lexer is pretty costly #2161

Open
athas opened this issue Jul 3, 2024 · 0 comments
Open

Tracking source locations in the lexer is pretty costly #2161

athas opened this issue Jul 3, 2024 · 0 comments

Comments

@athas
Copy link
Member

athas commented Jul 3, 2024

Our lexer spends about 50% of its runtime constructing and maintaining source position information. Most of this information is not actually going to be used (even a very verbose error message may only need to reference about a handful).

Perhaps we should instead identify source positions simply by a character offset, and then compute column/line number as necessary by reference to the file, when needed.

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

No branches or pull requests

1 participant