-
Notifications
You must be signed in to change notification settings - Fork 56
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
performance-analysis: case-insensitive parser #257
Comments
(Inspired by https://alic.dev/blog/fast-lexing) I did some quick and dirty benchmarking to see if there are any performance hits using a case-insensitive lexer and as far as I can tell there aren't any (at least none you'd feel). The corpus for the benchmark consists of all ST files in our repository, saved in one file via let now = Instant::now();
while !lexer.is_end_of_stream() {
lexer.advance();
}
let elapsed = now.elapsed().as_micros(); returns the following
Maybe I'm missing something as these numbers are kinda surprising to me to be honest; anyways here's the code master...__bench_lexer Follow-up: Is there any interest in creating a metric for the lexer in case we implement a hand-written lexer at some point in the future for whatever reason? Also this section seems obsolete https://plc-lang.github.io/rusty/arch/parser.html#discussion-rusty-lexer? |
I agree that the time spent in the lexer seems insignificant, so lets not spend too much effort here. |
Great, closing this issue then. |
measure the performance-penalty of the case-insensitive parser introduced in #255 using huge files.
The text was updated successfully, but these errors were encountered: