Skip to content

Improvement Refractor: optimize rule matching by using radix trie and Aho-Corasick #703

Open
@e1732a364fed

Description

@e1732a364fed

example code:
https://github.com/e1732a364fed/clash_rules/blob/main/src/lib.rs

The code is also at
https://crates.io/crates/clash_rules

The benchmark shows that the optimization can speed up about 4000%.

However, refractor is needed as Vec<Box<dyn RuleMatcher>> can not adopt the improvement algorithms.

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