oxc-project / oxc-project/backlog

Linter: Reduce size of thread pool when linting small number of files

Open
#187 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-linter
Dominant language
No language data
Stars
7
Forks
0
PR merge metrics
No merged PRs in 30d

Description

If linting only a small number of files, and import plugin is not used, there's no need to create a thread pool of threads. Number of threads in pool could be cmp::min(files_to_lint_count, cpu_core_count).

In particular, people sometimes want to lint just a single file, or only staged files.

I'm not sure what cost of launching threads is. If it's extremely cheap, and it's not easy to know in advance how many files are going to be linted, this change may not be worthwhile.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the linter entry point that creates the thread pool and inspect how the number of files to lint is known. Measure or test linting a single file and a small file set, then confirm the pool size is bounded by the file count when the import plugin is unused without changing the import-plugin path.

Written by the indexing model from the issue text.

Assessment

Domain
performance, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.