Skip to content

Bug: Performance regression from #7752 in project service due to changed file name casing #8519

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Overview

Following up on https://twitter.com/OliverJAsh/status/1757013260698607983:

@JoshuaKGoldberg @bradzacher 👋 After upgrading typescript-eslint from 6.15 to 6.16 we're having perf issues. It seems to be related to EXPERIMENTAL_useProjectService + #7752. I'd like to file an issue but I'm struggling to create a reduced test case for it.

@OliverJAsh and I went over the reproduction in a 1:1 just now (thanks again Oliver! 🙌). It was in fact #7752's changes to useProgramFromProjectService. Specifically the changes to the file path provided to projectService.openClientFile. Roughly:

-  const opened = projectService.openClientFile(
-    absolutify(parseSettings.filePath),
+  const filePath = getCanonicalFileName(parseSettings.filePath);
+  const opened = service.openClientFile(
+    ensureAbsolutePath(filePath, service.host.getCurrentDirectory()),

The resultant file path provided changed casing. Roughly:

- /Users/user/repos/path/to/file.ts
+ /users/user/repos/path/to/file.ts

This, for some reason, caused the project service to jump from ~5-7 seconds of file parse time to ~30-50 seconds or so.

cc @jakebailey as FYI.

Metadata

Metadata

Labels

accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: typescript-estreeIssues related to @typescript-eslint/typescript-estreeperformanceIssues regarding performance

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions