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

perf: Let the lexer operate on u8 instead of char to improve read performance. #23

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

LinZhihao-723
Copy link
Contributor

Description

When reading char, the underlying reader has to do utf8 validation, which is slow and unnecessary in our use case. This PR changes the lexer to directly operate on u8, which increases the performance by ~15% in the benchmark data set.

Validation performed

  • Ensure all workflows passed.
  • Ensure example works well, with unicode handled
  • Ensure benchmark performance gets better

@Louis-He Louis-He merged commit 9d058af into Toplogic-Inc:main Dec 16, 2024
2 checks passed
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.

2 participants