-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
Normalized filename in cache #997
Conversation
@sylc! Thanks. I did some testing locally on this very large sample project: https://github.com/TypeStrong/ts-node-repros/tree/754/src Turns out we need to normalize paths at the very top of The problem is, even if we keep normalized paths in our cache, we still end up passing un-normalized paths to the compiler, for example to Node's require mechanism passes us Windows When I made that change, and with It was still terrible without |
…t of ts-node's codebase only deals with / paths
@sylc I went ahead and pushed an implementation of what I described. We can always revert back to yours if it turns out I was wrong. |
@cspotcode thanks for looking into it. I tested your changes on my project and it is working. (timings are the same as with tsc 3.7.5) 👍 Altough I have a couple of question:
thanks |
Awesome, thanks!
The test is intentionally written to dynamically require 1000 files as opposed to statically In this situation, without With The difference is typechecking the project 1000 times vs only once.
@blakeembrey might have a better answer, but here's what I know. If your codebase uses The compiler has a distinction between "files discovered via imports" and "files explicitly included in the files array." Due to #999, we have to change how we deal with the latter. When I have another PR to avoid modifying the "files explicitly included" array unless absolutely necessary, which should help. EDIT: specifically to answer your question about which option is faster: |
Fix #754 (comment)
These changes make the filename used to index the cache normalized.
Tested on windows only on https://github.com/sylc/ts-node-debug