Skip to content

20x slowdown compared to 0.11.x #975

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
1 task done
alexdima opened this issue Feb 19, 2019 · 5 comments
Closed
1 task done

20x slowdown compared to 0.11.x #975

alexdima opened this issue Feb 19, 2019 · 5 comments
Labels
help wanted Contributions are especially encouraged

Comments

@alexdima
Copy link

Expected Behavior

Typedoc works as before, and takes reasonable time to execute.

Actual Behavior

Typedoc is super super slow, going from 2.5s (v0.11.1) to 49s (v0.14.2).

Steps to reproduce the bug

 Measure-Command {..\typedoc-0.11.1\node_modules\.bin\typedoc --mode file --out out --includeDeclarations --entryPoint monaco monaco.d.ts}
TotalMilliseconds : 2499.9106

Measure-Command {..\typedoc-0.13.0\node_modules\.bin\typedoc --mode file --out out --includeDeclarations --entryPoint monaco monaco.d.ts}
TotalMilliseconds : 44939.4815

Measure-Command {..\typedoc-0.14.2\node_modules\.bin\typedoc --mode file --out out --includeDeclarations --entryPoint monaco monaco.d.ts}
TotalMilliseconds : 48930.0364

Environment

  • Typedoc version: 0.14.2
  • Node.js version: 0.15.1
  • OS: Windows
@alexdima alexdima added the bug label Feb 19, 2019
@aciccarello aciccarello added help wanted Contributions are especially encouraged Priority: 2 labels Feb 19, 2019
@aciccarello
Copy link
Collaborator

Thanks for the report. I wonder if this is a windows focused issue.

Related to #960

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 19, 2019

I think this must be a windows issue, I haven't run into it. Thanks for the reproduction! Time to pull out git bisect and see what went wrong.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 20, 2019

git bisect says d4b2f56 is the first bad commit, I haven't had time to look into what exactly the issue is.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 7, 2019

Finally getting back to this, and I still have absolutely no clue why updating to TS 3.x causes this major slowdown when compilation speed remains essentially constant.

The Chrome devtools simply can't handle TypeDoc when trying to parse the above file. I get a hard crash as soon as the profiling is complete, which is making this more difficult than it ought to be.

Even the built in profiler with --prof has issues, when trying to generate useful output from the log file with node --prof-process --preprocess -j .\isolate-000002C68C42A0C0-v8.log | flamebearer I get a ton of Code move event for unknown code: 0x1ba.. errors.

Despite this, I have managed to discover a few performance issues which let me reduce the runtime of the 20x slower code to 15x slower... which obviously isn't great. I'm still missing the core issue. Hopefully I'll be able to discover what exactly is happening with more investigation.

Gerrit0 added a commit that referenced this issue May 7, 2019
It is used in getChildByName to search children, which led to *always* searching all children, which is especially problematic for any deeply nested structures.

Improves convert time by 25% on the monaco.d.ts file in #975
Gerrit0 added a commit that referenced this issue May 8, 2019
* Allow TraverseCallback to bail out early

It is used in getChildByName to search children, which led to *always* searching all children, which is especially problematic for any deeply nested structures.

Improves convert time by 25% on the monaco.d.ts file in #975

* Fix coverage report
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 28, 2020

Well, whatever the issue was... we're back to being pretty fast.

C:\Users\gtbir\Desktop\library-tests> measure-command { npx typedoc .\src\monaco.d.ts }
Rendering [========================================] 100%

...
TotalMilliseconds : 4750.1524

@Gerrit0 Gerrit0 closed this as completed Nov 28, 2020
@Gerrit0 Gerrit0 removed the bug label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

3 participants