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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JoshuaKGoldberg opened this issue Feb 20, 2024 · 3 comments 路 Fixed by #8520
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: typescript-estree Issues related to @typescript-eslint/typescript-estree performance Issues regarding performance
Milestone

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Feb 20, 2024

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.

@JoshuaKGoldberg JoshuaKGoldberg added bug Something isn't working package: typescript-estree Issues related to @typescript-eslint/typescript-estree accepting prs Go ahead, send a pull request that resolves this issue labels Feb 20, 2024
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Feb 20, 2024
@JoshuaKGoldberg JoshuaKGoldberg added this to the 8.0.0 milestone Feb 20, 2024
@jakebailey
Copy link
Collaborator

This doesn't feel too dissimilar to #1192 (comment).

@jakebailey
Copy link
Collaborator

And if his happens at the CLI, running it via pprof-it would be pretty helpful.

@JoshuaKGoldberg
Copy link
Member Author

I plan on Soon 鈩笍 setting up tooling to make arbitrary sized projects for testing different performance behaviors (#8087, also #7906). Looking forward to hopefully being able to repro these things in public & run pprof-it & the like.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: typescript-estree Issues related to @typescript-eslint/typescript-estree performance Issues regarding performance
Projects
None yet
3 participants