diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-10-17 10:42:32 +0200 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-12-08 10:08:10 -0800 |
| commit | 4ef1866dba127a9c12f4c475d3bbb6aaac97a243 (patch) | |
| tree | 87c930b0b907b5f0c024fb2e4485f3b6c4ddd0f5 /ci | |
| parent | 908e85b326ff161273f079a4f4fa3dfd207ced9c (diff) | |
| download | meson-4ef1866dba127a9c12f4c475d3bbb6aaac97a243.tar.gz | |
mparser: lexer: reduce regular expression usage
Match single-character tokens a separate dictionary lookup.
As pointed out by dcbaker, this is even faster than str.index
and gives the syntax error check for free (via KeyError).
It also enables splitting the special-case "if" in two parts, one
for long tokens and one for short tokens, thus providing further
speedup.
This shaves about 2/3rds of the time spent in lex().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'ci')
0 files changed, 0 insertions, 0 deletions
