-
-
Notifications
You must be signed in to change notification settings - Fork 737
Why is typedoc so slow on Windows? #960
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Could you provide your TypeDoc configuration? I suspect something odd is going on with the |
Thanks for the quick response. Here's my entire
I invoke it via |
I'm curious what the difference in time is for an initial typescript compile between windows/mac. Is it comparable? |
Yeah mine takes about a whole minute generating: typedoc --out ./docs/ ./index.d.ts --includeDeclarations --theme minimal --ignoreCompilerErrors --mode modules --exclude ./node_modules/**/* Is this a feature or a bug? 😛 |
Definitely a bug, just one that is unfortunately incredibly difficult to track down. I'm still not sure why it got so slow when just upgrading the TS version. The investigation is being tracked in #975 |
If anyone is having issues with typedoc taking significantly longer to run than typescript takes to compile, please open a new issue with a reproduction. TypeDoc works pretty well, with the vast majority of the run time spent in the compiler in my experiments recently. |
@Gerrit0 I've a situation where typedoc takes a very long time, but that's trying to build documentation from a Trying to
and then it just pegs a core and logs nothing more (for at least 10 minutes). This is trying to build the documentation for https://github.com/octokit/openapi-types.ts which is a bit of a monster (the entry point is 1.5MB), it doesn't use typedoc by default but I added the following {
"compilerOptions": {
"strict": true
},
"typedocOptions": {
"entryPoints": ["packages/openapi-types/types.d.ts"],
"out": "docs",
"readme": "none",
}
} this may not be correct at all though. edit: ended up killing the process after
it never logged anything after what's earlier. |
Please open a new issue rather than reviving one that's been closed for ages |
Sure. |
This is mainly a note for future searchers trying to find why their Windows doc build is slow... If your process takes minutes to run on Windows, and you're using Cygwin to run it (and/or a VSCode cygwin shell), but there's very little CPU or I/O showing for node in resource monitor, try adding The issue is that typedoc runs git over and over and over again with spawnSync, which on other operating systems is fast, but on Wiindows is slow. It's not helped by the fact that it appeared to have no caching or batching whatsoever -- it was rerunning the same 4 calls to git over and over and over. The root issue was that typedoc created a "repository" for every source reference, instead of caching one per file path. On further investigation, I found that this was because the paths typedoc was sending to git were of the form So the workaround is to use --disableGit when running from Cygwin, or to tweak PATH while running typedoc such that it sees Windows' git rather than Cygwin. (You can do this from typedoc.config.cjs in a pinch.) It would be nice if (Alternately, having a way to specify a path to the correct Git instance to use would be helpful, as I could make my config.cjs file just set that based on the environment rather than hacking PATH.) But since my workaround is just two lines in .config.cjs and another in my .envrc, it's not a huge deal if neither of these get changed, especially since Cygwin users are probably a bit rare these days. |
Expected Behavior
I'd like typedoc to finish in less than 30 seconds.
Actual Behavior
I have a repo with about 180 TypeScript files, and typedoc takes about 7 seconds on my iMac Pro, and... more than 6 minutes on my WIndows 10 machine.
Both are 64-bit machines, and both have way more RAM than typedoc is using. Also both have SSD hard drives and multiple cores.
Steps to reproduce the bug
I wish I could share my repo here, but unfortunately it is private. Maybe try any repo with more than 100 .ts files, and compare on Windows vs. other operating systems.
Environment
The text was updated successfully, but these errors were encountered: