[feature] Rule performance / most expensive tests
Author: kam193Created Jul 11, 2026Updated Aug 24, 2026
Labelsenhancement
⭐ Suggestion
It would be great to be able to optionally collect metrics on time consumed by specific rules, the best as part of JSON output.
Use Cases
I use AST-Grep as part of deobfuscation tooling, which means it can be used on intentionally not-optimized files, with constructs you rarely see normally (like extream long lists). To fight with performance issues, I need to understand which of the rules I use consumes the most time. Presently, I understand (correct me if I missed something) that the only way for that is to exclude rules one-per-one and measure the difference in time. I would appreciate it if I could get this information from the AST-Grep itself.
Source: ast-grep/ast-grep