Skip to content
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

Do not merge file patterns into a single regular expression #61104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelMitchell-at
Copy link

@MichaelMitchell-at MichaelMitchell-at commented Feb 3, 2025

Fixes #61103

Recommend viewing using Github's "Unified" view as some of these lines are quite long.

Benchmark

Running tsc on this repo which demonstrates slow performance: https://github.com/MichaelMitchell-at/typescript_slow_wildcards_repro

Before:

$ hyperfine 'node ./built/local/tsc.js -p ../typescript_slow_wildcards_repro/tsconfig.json'
Benchmark 1: node ./built/local/tsc.js -p ../typescript_slow_wildcards_repro/tsconfig.json
  Time (mean ± σ):      7.720 s ±  0.237 s    [User: 7.780 s, System: 0.071 s]
  Range (min … max):    7.480 s …  8.280 s    10 runs

After:

$ hyperfine 'node ./built/local/tsc.js -p ../typescript_slow_wildcards_repro/tsconfig.json'
Benchmark 1: node ./built/local/tsc.js -p ../typescript_slow_wildcards_repro/tsconfig.json
  Time (mean ± σ):     365.1 ms ±  14.9 ms    [User: 680.9 ms, System: 45.8 ms]
  Range (min … max):   353.1 ms … 403.9 ms    10 runs

@MichaelMitchell-at
Copy link
Author

Hm, after testing this change on our codebase, which is on the order of thousands of projects, I'm seeing a net performance decrease, but each individual project is sometimes faster or slower with this change. It seems that there's more nuance to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Performance degrades the more wildcards that are contained in TSConfig include or exclude patterns
2 participants