Skip to content

perf(linter): experiment: skip rules when no nodes match #12178

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

Conversation

camchenry
Copy link
Member

@camchenry camchenry commented Jul 10, 2025

This is an experimental branch, I do not intend to merge these changes as-is. This is a test to see if skipping more rules by just looking at AST node kinds can have a meaningful impact on performance.

@github-actions github-actions bot added A-linter Area - Linter A-semantic Area - Semantic C-performance Category - Solution not expected to change functional behavior, only performance labels Jul 10, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codspeed-hq bot commented Jul 10, 2025

CodSpeed Instrumentation Performance Report

Merging #12178 will improve performances by 4.79%

Comparing 07-09-perf_linter_experiment_skip_rules_when_no_nodes_match (c4becbb) with main (466241d)

Summary

⚡ 1 improvements
✅ 33 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
linter[RadixUIAdoptionSection.jsx] 2.5 ms 2.4 ms +4.79%

@camchenry
Copy link
Member Author

I converted two dozen or so rules that I saw in profiling initially. I'll add more to this as the initial results seem promising. On small files like the RadixUIAdoptionSection.jsx benchmark it is up to 5% faster on walltime. On larger files it is still an improvement as we can skip many node iterations potentially.

Screenshot 2025-07-09 at 10 23 57 PM

@camchenry camchenry force-pushed the 07-09-perf_linter_experiment_skip_rules_when_no_nodes_match branch from 4490b87 to a6358f9 Compare July 10, 2025 03:13
@camchenry
Copy link
Member Author

I would say this experiment was successful. I have some ideas on how to further improve this method, but I'll polish this up on a separate branch and split it up into a stack of PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter A-semantic Area - Semantic C-performance Category - Solution not expected to change functional behavior, only performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant