Skip to content

Using "exclude" instead of "filesGlob" in tsconfig.json produces large amounts of pending requests. #634

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

Closed
ralfbiedert opened this issue Oct 1, 2015 · 13 comments
Labels

Comments

@ralfbiedert
Copy link

When I move from filesGlob to excludes in my tsconfig.json I get lots of pending requests that take long to resolve, even for tiny stub projects containing only 2 files. For larger projects Atom becomes unusable.

screen shot 2015-10-01 at 14 44 15

screen shot 2015-10-01 at 14 52 54

Once I revert to filesGlob and restart Atom things are back to normal.

This bug could be related to #624.

I am using Atom 1.0.19, atom-typescript 7.0.2, Typescript 1.7.0-dev.20151001 on Mac OS 10.11, however I could observe this behavior for older Atom versions, atom-typescript 5.x and Typescript 1.5.

@basarat
Copy link
Member

basarat commented Oct 5, 2015

exclude wasn't supported till a day ago : https://github.com/TypeStrong/atom-typescript/releases/tag/v7.0.3

So try again, and comment if it still doesn't work 🌹

@basarat basarat closed this as completed Oct 5, 2015
@ralfbiedert
Copy link
Author

Just checked with 7.1.3 and I still get the pending requests in my big project:

screen shot 2015-10-05 at 10 37 24

@basarat basarat reopened this Oct 5, 2015
@nycdotnet
Copy link
Contributor

Note - I wound up with a perf problem in grunt-ts when I implemented exclude as well. Adding a "not glob" doesn't actually help because the glob matcher isn't clever enough to optimize away that work. It goes searching through all the excluded folders and then ignores whatever it finds.

Here was my fix:
TypeStrong/grunt-ts@cad78cc

Basically I add *.ts and *.tsx in the current folder. Then I enumerate the names of the subfolders in the folder containing tsconfig.json. Then I remove the excluded subfolders and then add **/*.ts and **/*.tsx for the remaining ones.

@blakeembrey
Copy link
Member

@ralfbiedert Can you confirm whether this is still an issue on the latest release? It's since moved to a more effective glob.

@ralfbiedert
Copy link
Author

Did a very quick check with 7.4.1 and it seems to be fixed. The number of pending requests briefly spikes up to 20, but returns to 0 after about 1s. Thanks!

@ralfbiedert
Copy link
Author

Hm, I don't know if this is a regression since 7.4.1, but I just tried 7.4.4 with another big project and again I got a number of pending requests that don't go away.

screen shot 2015-10-21 at 10 49 16

@ralfbiedert ralfbiedert reopened this Oct 21, 2015
@blakeembrey
Copy link
Member

@ralfbiedert Is the exports key a typo?

@blakeembrey
Copy link
Member

Actually, I have the same issue on my project too - I just tried going back multiple versions when it was previously working and it seems I have the same issue still, not sure where or how this got introduced now.

@blakeembrey
Copy link
Member

@basarat Do you have an idea of how to debug the slowness? I can't seem to narrow it down by just throwing out guesses and globbing should not be this slow (ignore is definitely still working outside of Atom). Is there a way to console.log inside whatever process is running this?

@basarat
Copy link
Member

basarat commented Oct 21, 2015

Is there a way to console.log inside whatever process is running this?

Yup console.error. See : https://github.com/TypeStrong/atom-typescript/blob/master/CONTRIBUTING.md#debugging

Note: There are only two processes ... one managed by atom aka. the atom window that just calls our functions ... and one we run in the background so as to not block the window thread.

@blakeembrey
Copy link
Member

Awesome, thanks 👍 By "whatever process" I was referring to however it was managed, not the number of them, but yeah - where does the different process get started from? 😄

@basarat
Copy link
Member

basarat commented Oct 21, 2015

where does the different process get started from?

Here in parent.ts

Its a bit of a mess ... but there wasn't a good OSS typed solution for this problem at that time. I cleaned up with a concept of contract/master/worker using a library simpleWorker e.g. https://github.com/basarat/tsb/tree/master/src/server/workers/fileListing ... which I plan to back port to atom-ts (or a node module) ... but don't see that happening till TSB is ready for public release.

FWIW TSB has a concept of active project (and tsb.json to list projects) that doesn't hit the disk as much and keeps it all in sync 🌹

@ralfbiedert
Copy link
Author

@blakeembrey: Ahhh, yes, mixed it up. Now that I changed it to exclude it seems to work here. Thanks! (Btw, I leave it up to you to close the issue since although it's solved for me there still seem to be problems)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants