- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 735
Efficiency enhancement after node profiler investigation #2386
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
PR welcome! Basically all of my test cases are tiny |
I just noticed this... wat, that makes me want to kill wbr. Not sure it provides any real value to begin with, it's a carryover from back when the themes were in handlebars. I'm working (hopefully tomorrow) on having navigation load dynamically, which should drastically reduce the number of calls to |
Gerrit0
added a commit
that referenced
this issue
Dec 15, 2024
The router implementation used by TypeDoc now indicates that in a 22.5 second run rendering all of `@types/node`, 65ms is spent getting URLs. The extra complexity in attempting to cache the result of this frankly isn't worth it. HTML rendering took 16.8 seconds, of which 13.6 seconds was just doing syntax highlighting. Shiki is the most obvious place to spend time investigating performance improvements at this point.
Gerrit0
added a commit
that referenced
this issue
Feb 9, 2025
The router implementation used by TypeDoc now indicates that in a 22.5 second run rendering all of `@types/node`, 65ms is spent getting URLs. The extra complexity in attempting to cache the result of this frankly isn't worth it. HTML rendering took 16.8 seconds, of which 13.6 seconds was just doing syntax highlighting. Shiki is the most obvious place to spend time investigating performance improvements at this point.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search Terms
getRelativeUrl, enhancement
Problem
Not a problem... an efficiency enhancement. We ran typedoc thru the nodeJs profiler to investigate why running typedoc against our system was taking so long.
Top 6 of the node profiler output:
There were 2 significant areas for us:
Suggested Solution
The enhancement we suggest is to use a Map to hold the results of previous conversions and return the held result if the key matches.
After we implemented this locally the getRelativeUrl went from 13.5%(2nd highest @55,925 ticks) of the total time to %0(99th highest @ 25 ticks).
For our project typedoc calls getRelativeUrl a total of 87,530,384 times (yup... that is 87.5 million)... 149,731 of those are unique... which means there are 87,380,653(99.83%) duplicate calls... we currently have 9,342 pages.
Even though a Map get/set are not noops... they use significantly less processing than Path.posix.relative... therefore we make huge savings (~13.5%) on processing with this small change.
Obviously with small projects this is probably not even noticeable. However, the larger the project the bigger the impact.
Latest profiling top 6 (using change above).
The text was updated successfully, but these errors were encountered: