-
Notifications
You must be signed in to change notification settings - Fork 60
Fix loading performance for pages with many links caused by excessive re-computation #900
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
Fix loading performance for pages with many links caused by excessive re-computation #900
Conversation
@swift-ci test |
@hqhhuang I removed the update logic from non-documentation-page components as we discussed offline since it's not technically necessary there yet. |
@swift-ci test |
1 similar comment
@swift-ci test |
Is this PR included in the content that's exposed with swift 6.0.2 (toolchain with Xcode 16.1), or is it coming in a future version of the swift toolchain (6.1?) (was it cherry picked?) |
I believe it is only on the latest development Swift toolchain at the moment. If you need a workaround using an existing toolchain, you can clone the latest version of swift-docc-render-artifact and set |
… re-computation (swiftlang#900) Resolves: rdar://136247329
… re-computation (swiftlang#900) Resolves: rdar://136247329
Bug/issue #, if applicable: 136247329 (#894)
Summary
This fixes a performance regression (#894) when loading pages with many links that was introduced with #878.
The problem is that any logic in the
referencesProvider
mixin does not get cached once for each client as I mistakenly assumed, so every component using this mixin was unintentionally re-running the logic for inactivating known external links, which becomes noticeable when there is a big list of references.To fix it, I moved this logic to the
setReferences
methods in the appropriate stores, and I'm making sure to update the refs and re-run this logic whenever the globalincludedArchiveIdentifiers
data changes.(I closed #898 which was a less ideal solution to this same issue—thanks for pointing out the root issue that I missed @hqhhuang!)
Testing
Describe how a reviewer can test the functionality of your PR. Provide test content to test with if
applicable.
Steps:
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded