Skip to content

perf(linter/plugins): reduce array lookups in visitor compilation#20249

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-11-perf_linter_plugins_reduce_array_lookups_in_visitor_compilation
Mar 12, 2026
Merged

perf(linter/plugins): reduce array lookups in visitor compilation#20249
graphite-app[bot] merged 1 commit intomainfrom
om/03-11-perf_linter_plugins_reduce_array_lookups_in_visitor_compilation

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 12, 2026

Small optimization to visitor compilation. Perform array lookup only once instead of twice in succession.

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 changes, fast-track this PR to the front of the merge queue

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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-performance Category - Solution not expected to change functional behavior, only performance labels Mar 12, 2026
@overlookmotel overlookmotel self-assigned this Mar 12, 2026
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 12, 2026
@overlookmotel overlookmotel marked this pull request as ready for review March 12, 2026 00:20
@overlookmotel overlookmotel requested a review from camc314 as a code owner March 12, 2026 00:20
Copilot AI review requested due to automatic review settings March 12, 2026 00:20
Copy link
Member Author

overlookmotel commented Mar 12, 2026

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes a small performance-oriented tweak to the visitor compilation teardown in apps/oxlint by reducing repeated array element lookups when resetting visitPropsCache.

Changes:

  • Reuses a local visitProp variable during visitPropsCache reset to avoid repeated visitPropsCache[i] indexing.
  • Adds an explanatory comment clarifying why specificity is not reset.

…0249)

Small optimization to visitor compilation. Perform array lookup only once instead of twice in succession.
@graphite-app graphite-app bot force-pushed the om/03-11-perf_linter_plugins_reduce_array_lookups_in_visitor_compilation branch from 90a0a14 to d160dca Compare March 12, 2026 00:30
@graphite-app graphite-app bot merged commit d160dca into main Mar 12, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/03-11-perf_linter_plugins_reduce_array_lookups_in_visitor_compilation branch March 12, 2026 00:41
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 12, 2026
leaysgur added a commit that referenced this pull request Mar 12, 2026
# Oxlint
### 🐛 Bug Fixes

- 4ea67de oxlint,oxfmt: Skip `vite.config.ts` exports `defineConfig(fn)`
(#20260) (leaysgur)
- cc89dbf oxlint: Skip `vite.config.ts` w/o `.lint` field in
auto-discovery (#20255) (leaysgur)
- 89b7ca9 linter/no-duplicate-imports: Only check aggregated exports
(#20178) (kennytm)
- 691f556 linter/explicit-module-boundary-types: Ignore constructor
callbacks (#20221) (camc314)

### ⚡ Performance

- d160dca linter/plugins: Reduce array lookups in visitor compilation
(#20249) (overlookmotel)

### 📚 Documentation

- 0c7da4f linter: Fix extra closing brace in example config. (#20253)
(connorshea)
- 13606c3 linter/plugins: Update conformance README (#20234)
(overlookmotel)
# Oxfmt
### 🐛 Bug Fixes

- 4ea67de oxlint,oxfmt: Skip `vite.config.ts` exports `defineConfig(fn)`
(#20260) (leaysgur)
- 11a2b45 oxfmt: Skip `vite.config.ts` w/o `.fmt` field in
auto-discovery (#20254) (leaysgur)

Co-authored-by: leaysgur <6259812+leaysgur@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins 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.

2 participants