-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Reduce exceptions #44710
Reduce exceptions #44710
Conversation
@typescript-bot perf test this |
Heya @amcasey, I've started to run the perf test suite on this PR at 7091edc. You can monitor the build here. Update: The results are in! |
@amcasey Here they are:Comparison Report - main..44710
System
Hosts
Scenarios
Developer Information: |
I'm extremely skeptical that this could have reduced check time since, AFAIK, none of our benchmarks are built in watch mode and the checker does not use |
@typescript-bot perf test this |
Heya @amcasey, I've started to run the perf test suite on this PR at d9ae52c. You can monitor the build here. Update: The results are in! |
@amcasey Here they are:Comparison Report - main..44710
System
Hosts
Scenarios
Developer Information: |
@@ -6506,7 +6506,9 @@ namespace ts { | |||
const visited = new Map<string, true>(); | |||
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames); | |||
for (const basePath of patterns.basePaths) { | |||
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth); | |||
if (directoryExists(basePath)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amcasey I wonder if this check is causing a behavior change in the material-ui benchmark and changing the number of .d.ts files that get loaded or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing --extendedDiagnostics
might be a good first step to figuring out whether there really is an observable behavior change, if you haven't already done that @amcasey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, we'd been discussing this offline and I forgot to update the issue. The perf suite was using the wrong baseline. I'll kick off a clean run now, but local testing showed no change in the check time of material-ui.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I should also say that I don't believe it will cause a behavioral change because visitDirectory
would just see an empty list of fs entries for the non-existent directory and stop.
The latest perf run shows no change, as expected. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amcasey Hi! I don't know if it the right place to ask a question but I found this thread relative to the problem (I'm sorry if it's not). Should directoryExists
be called with an absolute path like directoryExists(combinePaths(currentDirectory, basePath))
?
I came across the undocumented breaking change in 4.4-beta that causes (for example) ts.sys.readDirectory("", [".ts",".tsx",".d.ts"],["node_modules","dist"],["**/*"])
to return an empty array. Before 4.4-beta it has been returning the correct array of files. So I wonder if it is a bug or desired behaviour.
Thank you in advance.
@typescript-bot perf test this |
Heya @amcasey, I've started to run the perf test suite on this PR at d9ae52c. You can monitor the build here. Update: The results are in! |
@amcasey Here they are:Comparison Report - main..44710
System
Hosts
Scenarios
Developer Information: |
This reverts commit c0d5c29.
As pointed out by @gretzkiy, the `directoryExists` call added to `matchFiles` in microsoft#44710 should have been passing the absolute path (since the current directory might not match `currentDirectory`).
* Pass absolute path to directoryExists As pointed out by @gretzkiy, the `directoryExists` call added to `matchFiles` in #44710 should have been passing the absolute path (since the current directory might not match `currentDirectory`). * Add test, simplify/clarify/fix matchFiles and friends Co-authored-by: Andrew Branch <andrew@wheream.io>
This reverts commit c0d5c29.
Component commits: 931b504 Revert "Fix RWC missing file detection (microsoft#46673)" This reverts commit 4a065f5. afef282 Revert "Pass absolute path to directoryExists (microsoft#46086)" This reverts commit 55b4928. f1a20b3 Revert "Reduce exceptions (microsoft#44710)" This reverts commit c0d5c29. 56842cd Add back system watcher limit
Component commits: 931b504 Revert "Fix RWC missing file detection (#46673)" This reverts commit 4a065f5. afef282 Revert "Pass absolute path to directoryExists (#46086)" This reverts commit 55b4928. f1a20b3 Revert "Reduce exceptions (#44710)" This reverts commit c0d5c29. 56842cd Add back system watcher limit Co-authored-by: Andrew Branch <andrew@wheream.io>
* Pass absolute path to directoryExists As pointed out by @gretzkiy, the `directoryExists` call added to `matchFiles` in microsoft#44710 should have been passing the absolute path (since the current directory might not match `currentDirectory`). * Add test, simplify/clarify/fix matchFiles and friends Co-authored-by: Andrew Branch <andrew@wheream.io>
…46787) * Revert "Fix RWC missing file detection (microsoft#46673)" This reverts commit 4a065f5. * Revert "Pass absolute path to directoryExists (microsoft#46086)" This reverts commit 55b4928. * Revert "Reduce exceptions (microsoft#44710)" This reverts commit c0d5c29. * Add back system watcher limit
Clean up a couple of exceptions that were being thrown repeatedly during initial project load of a large project on Linux:
matchFiles
shouldn't callvisitDirectory
onbasePaths
that don't exist (throwing fromrealpath
andreaddir
)After this change, "All Exceptions" causes the debugger to stop exactly twice: when
typescript-etw
is found to be absent and the first time the file watcher limit is hit.This change is purely to make it easier to enable "All Exceptions" when debugging TypeScript - not for correctness or (significant) perf improvements.