-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Suggestions regression since 3.6.0-dev.20190713 #32441
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
Comments
If this statement in #31893 (comment) is still true and it would include all @andrewbranch could you please confirm that all |
Whoa, 90ms to 11 seconds? 😱 That’s obviously unacceptable, and since you isolated the change to a single day, I feel quite confident it’s #31893. I’m going to revert it for now because that’s just unusable. As far as missing things go, there’s a test verifying that multiple levels of package.jsons are looked at, so I’m not sure what the problem is there, but would love your help investigating further once I can improve the performance. Thanks for the detailed reports! |
Do you have any suggestions what I should check (or profile) first in order to narrow root cause? Also I would like to mention that I encountered this problem on large project, and when tried to create repro with 2-3 files everything worked as expected (suggestions were fast and also contained auto imports from other files). |
Shouldn’t #31893 cause the compiler to do less work, not more? |
I haven't done any profiling or detailed look at PR (so may be wrong in my assumptions), however first thing that I will check if it is because of deep nesting because of convention + 2 Also comment #31893 (review) isn't marked as resolved so I'm not sure if it is possible to cache everything. But at this time it's just a speculation on my part. |
You’d think so intuitively, but no—all those external modules are already in the program, so getting the whole lot of them is pretty easy. Adding additional filters to them adds work. (Particularly, looking for and reading package.json files, and deduplicating re-exports of the same symbol taking into account that some re-exports might be in modules specified in package.json while some may not be.)
It should be possible, but the caching didn’t make it into that PR. If I make a second attempt, it will likely have to include a caching scheme.
Do you mean for the performance regression or for the missing exports? For the perf, my plan is just to run a JS sampling profiler with ndb to see what’s taking so much time. For the missing exports, you could probably figure it out just by stepping through the filtering code I added to |
I reverted the problematic PR, but I’ll leave this one open to track the progress of bringing it back. |
@andrewbranch thank you! I will verify timings with that next build and follow up. Also I tried to debug tsserver, but no luck. I was using approach described in Debugging Language Service in VS Code - I can see that Or I should launch tsserver manually (with ndb) and call it directly to profile? |
Yeah, but the order of the steps there is important—is it possible you set the environment variable and then tried to attach to an existing VS Code instance? I usually just do Also, it’s much easier to debug a local build of TypeScript with source maps—not sure if you were doing that or not. Clone TypeScript, |
If it works for you that it is something strange with my PC - nothing runs on selected post (even after project is fully processed by tsserver and I can see suggestions).
Working examples for browser and nodeBrowser running with
For
Anyway, now I'm sure that it is correct way to debug tsserver and only one step left.
Thanks for the tip! Will be useful when I will attach debugger. |
FWIW I’m on a Mac and it looks like you’re on Windows, but everything I see here looks correct 🤔 |
As usually: checked 3 times on different ports that it doesn't work, posted GitHub comment, tried one more time and voilà - there is response for Thanks for the help. I will let you know if I'll find anything useful. |
Checked Haven't chance to profile slow nightly builds yet. |
The culprit is the repeated calls of this stack: |
TypeScript Version:
3.6.0-dev.20190717
(first version with problem3.6.0-dev.20190713
)Search Terms: completion, completionInfo, autoimport
It is hard to provide repro code since this problem is found in large (4388 files processed by TS) code base with closed source.
However I see two regressions:
Performance problem
In TS Server log is see huge difference in performance and value for Semantic work
Log for
3.6.0-dev.20190713
(and later)Log for
3.6.0-dev.20190712
Suggestion form other files
This is project written in JS has
@types
packages innode_modules
1 level above projectpackage.json
(since it isn't commited for everyone)Related Issues:
Probably related to #31893 however it is unclear why there is big performance hit for "local" suggestions and why I'm unable to see suggestions from other files even (in the same folder).
I would understand why there might be no globals
@types/*
that are not specified inpackage.json
, but not sure why there are no suggestion from other files at all.Would be glad to follow instructions that will help to narrow this problem, however cannot provide source code.
The text was updated successfully, but these errors were encountered: