Skip to content

Tracking issue: performance optimization #185

@blindFS

Description

@blindFS

As mentioned in zed-industries/extensions#2068 (comment), current parser is fairly complicated, and needs to be optimized.

Status

State Count

> rg "#define.*STATE" src/parser.c

16:#define STATE_COUNT 7954
17:#define LARGE_STATE_COUNT 1749

Top Results of States for Rule

tree-sitter generate --report-states-for-rule -
rule name count
val_table 1107
val_range 817
expr_binary_parenthesized 614
shebang_repeat1 573
_immediate_decimal 474
_val_range 374
val_table_repeat1 363
_val_number_decimal 362
collection_type 330
_multiple_types_repeat1 272
_val_range_with_end 266
expr_binary 210
collection_type_repeat1 189
val_closure 183
unquoted 174
_unquoted_anonymous_prefix 166
_unquoted_with_expr 165
ctrl_if_parenthesized 158
_str_double_quotes 156

References

https://github.com/tree-sitter/tree-sitter/wiki/Tips-and-Tricks-for-a-grammar-author#reducing-state-count

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions