Skip to content

perf(vscode): restrict searching for oxlint/oxfmt binaries only 3 levels deep + 10s timeout#17345

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-24-perf_vscode_search_for_root_directory_oxlint_oxfmt_binaries_before_searching_with_glob
Jan 2, 2026
Merged

perf(vscode): restrict searching for oxlint/oxfmt binaries only 3 levels deep + 10s timeout#17345
graphite-app[bot] merged 1 commit intomainfrom
12-24-perf_vscode_search_for_root_directory_oxlint_oxfmt_binaries_before_searching_with_glob

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Dec 24, 2025

No description provided.

@github-actions github-actions bot added A-editor Area - Editor and Language Server C-performance Category - Solution not expected to change functional behavior, only performance labels Dec 24, 2025
Copy link
Member Author

Sysix commented Dec 24, 2025


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.

@Sysix Sysix force-pushed the 12-24-perf_vscode_search_for_root_directory_oxlint_oxfmt_binaries_before_searching_with_glob branch from 2bb6f02 to b9ec375 Compare December 24, 2025 22:47
@Sysix Sysix requested a review from Copilot December 24, 2025 22:48
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 introduces a performance optimization for binary path searching in the VSCode extension by checking the workspace root's node_modules/.bin directory before performing an expensive glob search. This improves performance especially on Windows where glob operations are slow.

Key Changes

  • Extracted binary search logic into a dedicated searchNodeModulesBin method
  • Added fast path check using workspace.fs.stat before falling back to glob search
  • Renamed parameter from defaultPattern to defaultBinaryName for clarity

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sysix Sysix force-pushed the 12-24-perf_vscode_search_for_root_directory_oxlint_oxfmt_binaries_before_searching_with_glob branch 3 times, most recently from 99d578e to b134a5e Compare December 24, 2025 23:33
@Sysix Sysix marked this pull request as ready for review December 25, 2025 00:03
@Sysix Sysix requested a review from camc314 as a code owner December 25, 2025 00:03
@nrayburn-tech
Copy link
Collaborator

There’s probably a simple answer, but why do you need to search for anything other than node_modules/.bin for each of the workspace folders?

Users in a monorepo with the package installed in the root would just work. Users in a monorepo with only a single version of the package could specify the path to one of them and that would work.

This wouldn’t work for users in monorepos that want to use different versions for different packages, but is that something that really needs to be supported?

@Sysix
Copy link
Member Author

Sysix commented Dec 25, 2025

My thought about searching deeper was:
Only one package in a monorepo can only use oxlint. The extension still works for them :)

This wouldn’t work for users in monorepos that want to use different versions for different packages, but is that something that really needs to be supported?

IMO this is creating too much overhead. Use one tool for the complete editor experience. Or we need to start X numbers of language server

@nrayburn-tech
Copy link
Collaborator

If only one package is using it within the monorepo, users could specify the path to the tool. This wouldn’t be saved in their project settings and typically committed, so I don’t think this is a problem. It’s not automatic, but it isn’t difficult or time consuming either.
Most other projects would have the package installed into one of the workspace roots.

I think those two alone cover most use cases and you wouldn’t need to use the VS Code search to find the file.

Just something to consider, I don’t think either your current approach or my suggestion is wrong. They just prioritize one behavior over the other, so it’s a trade off.

@Sysix
Copy link
Member Author

Sysix commented Dec 28, 2025

Your point is valid :) I was am not sure, if we want to include a manual user defined setting for this use case.
For me, it is always "no configuration" and just start. But this is somehow complex for this user story :)

@MIreland
Copy link

MIreland commented Jan 2, 2026

Thanks for putting this together!

This does address #17578 for me, but only if oxfmt is installed.

If oxfmt is not installed, the plugin still hangs for me. How do we feel about adding a timeout on findFiles?

@Sysix Sysix force-pushed the 12-24-perf_vscode_search_for_root_directory_oxlint_oxfmt_binaries_before_searching_with_glob branch from b134a5e to 2f36318 Compare January 2, 2026 15:33
@Sysix
Copy link
Member Author

Sysix commented Jan 2, 2026

How do we feel about adding a timeout on findFiles?

Added a Timeout of 10s and restricted the search to look only 3 levels deep. Thank you for the suggestions

@Sysix Sysix changed the title perf(vscode): search for root directory oxlint/oxfmt binaries, before searching with glob perf(vscode): restrict searching for oxlint/oxfmt binaries only 3 levels deep + 10s timeout Jan 2, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 2, 2026
Copy link
Contributor

camc314 commented Jan 2, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the 12-24-perf_vscode_search_for_root_directory_oxlint_oxfmt_binaries_before_searching_with_glob branch from 2f36318 to 605dbf1 Compare January 2, 2026 17:51
@graphite-app graphite-app bot merged commit 605dbf1 into main Jan 2, 2026
19 checks passed
@graphite-app graphite-app bot deleted the 12-24-perf_vscode_search_for_root_directory_oxlint_oxfmt_binaries_before_searching_with_glob branch January 2, 2026 17:56
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 2, 2026
@Meligy
Copy link

Meligy commented Jan 5, 2026

Any idea when this might be released to test if it fixes #17586 ? Thanks a lot.

@camc314
Copy link
Contributor

camc314 commented Jan 5, 2026

Any idea when this might be released to test if it fixes #17586 ? Thanks a lot.

in a couple of hours

graphite-app bot pushed a commit that referenced this pull request Jan 5, 2026
# Oxlint
### 💥 BREAKING CHANGES

- f7da875 oxlint: [**BREAKING**] Remove oxc_language_server binary (#17457) (Boshen)

### 🚀 Features

- 659c23e linter: Init note field boilerplate  (#17589) (Shrey Sudhir)
- 6870b64 parser: Add TS1363 error code (#17609) (Sysix)
- 6154c8c linter/eslint-plugin-vitest: Implemented vitest/warn-todo rule (#17228) (Said Atrahouch)
- 0043cd6 linter/eslint-plugin-vitest: Implement consistent-vitest-vi rule (#17389) (Said Atrahouch)
- a6d773d linter: Add full TS support to eslint/no-useless-constructor (#17592) (camc314)
- f02c0e7 linter/eslint: Implement complexity (#17569) (Nguyen Tran)
- bc7aae7 linter/no-unused-vars: Add fixer to remove unused catch bindings (#17567) (Don Isaac)
- 9e8ec78 linter/only-throw-error rule: Add `allowRethrowing` option for  (#17554) (camc314)
- b67e819 linter: Add fixer for `unicorn/prefer-response-static-json` rule (#17559) (Mikhail Baev)
- 44b0361 linter/vue: Implement no-this-in-before-route-enter (#17525) (yefan)
- ee34716 linter/react: Implement no-will-update-set-state (#17530) (Kenzo Wada)
- 3088e1d linter/react: Implement no-this-in-sfc (#17535) (Kenzo Wada)
- 29a2868 linter/jsx-a11y: Implement no-static-element-interactions (#17538) (Kenzo Wada)
- eadf057 linter: Enable tsconfig auto discovery by default (#17489) (Boshen)
- 12a7d6e website_linter: Add a count of rules with fixes available to rules table. (#17476) (Connor Shea)

### 🐛 Bug Fixes

- a702f13 oxlint/lsp: Correct position for "disable for this file" with shebang (#17613) (Sysix)
- 19fdfb6 linter: Panic in `sort-keys` rule with Unicode numeric characters (#17629) (Adel Rodríguez)
- 2e8f469 vscode: Search for `node_modules/.bin/oxlint.exe` too (bun setup) (#17597) (Sysix)
- be39906 linter/aria-proptypes: Allow template literals with expressions for string-type ARIA props (#17460) (Jökull Sólberg Auðunsson)
- 529901c linter: Include JS plugin rules when calculating total rule count (#17520) (connorshea)
- 96ef2cc linter: Print total rule # when using a single nested config (#17517) (connorshea)
- 9ad0f29 oxlint: Do not enable external plugin store when no external linter is passed (#17498) (Sysix)
- 174375d oxfmt,oxlint: Disable mimalloc for 32-bit Arm targets (#17473) (Yaksh Bariya)
- ff70fe9 linter/no-standalone-expect: Allows expect in wrapper functions passed to test blocks (#17427) (Copilot)
- dab232f linter/catch-or-return: Handle arrow functions with implicit returns correctly (#17440) (Copilot)
- a38892a linter: Update no-unnecessary-template-expression docs and test case (#17453) (camc314)

### ⚡ Performance

- 605dbf1 vscode: Restrict searching for oxlint/oxfmt binaries only 3 levels deep + 10s timeout (#17345) (Sysix)

### 📚 Documentation

- 884fb63 linter/react: Improve docs for jsx-curly-brace-presence (#17579) (connorshea)
- 1d3ee07 linter: Improve rule explanation for `vue/no-this-in-before-route-enter`. (#17581) (connorshea)
- 5f189f8 linter/arrow-body-style: Correctly document default mode option (#17566) (Rägnar O'ock)
- bb2e8e4 linter: Add a note to the `typescript/no-var-requires` rule about the missing `allow` option (#17551) (connorshea)
- 655afc1 linter: Improve docs for `import/extensions` and add a few more tests (#17539) (connorshea)
- 7e5fc90 linter: Update list of plugins that are reserved. (#17516) (connorshea)
# Oxfmt
### 💥 BREAKING CHANGES

- f7da875 oxlint: [**BREAKING**] Remove oxc_language_server binary (#17457) (Boshen)

### 🚀 Features

- 8fd4ea9 oxfmt: `options.embeddedLanguageFormatting` is now `"auto"` by default (#17649) (leaysgur)

### 🐛 Bug Fixes

- c9b5d7d formatter/sort_imports: Handle alignable_comment correctly (#17646) (leaysgur)
- 453222d formatter: Missing comment handling for end-of-line comments in member chains (#17659) (Dunqing)
- 0805ff2 formatter: Incorrect inline comment placement in try-catch (#17657) (Dunqing)
- 3a0c782 formatter: Don't move comments into optional call parentheses (#17582) (magic-akari)
- 174375d oxfmt,oxlint: Disable mimalloc for 32-bit Arm targets (#17473) (Yaksh Bariya)

### ⚡ Performance

- abb28dc oxfmt: Turn of pretty print from sort-package-json (#17452) (Boshen)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server 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.

7 participants