You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lolbinarycat opened this issue
Mar 16, 2025
· 2 comments
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
I recently discovered this in #138574, when I fixed the bug for the main page, but the erroneous items were still in the sidebar.
If we simply collected a list of sidebar items during rendering of the main page, almost the entirety of sidebar.rs could be removed. This could even be done incrementally, with each sidebar_* function being replaced with a field on Context.
The text was updated successfully, but these errors were encountered:
lolbinarycat
added
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
labels
Mar 16, 2025
IIUC, it would also mean we won't need interior mutability for deref_id_map, which might improve performance by a little bit.
And consequently, might also allow us to "lazily" render the content and sidebar into the same buffer, which might improve perf, maybe even substantially.
I'm thinking we'll add a field to Context, like sidebar_map: HashMap<ItemId, SidebarLinks>, where SidebarLinks is a struct that has fields for each different type of sidebar item.
The one downside is that Link will likely be unable to effectively use Cow, which will have some impact due to some extra cloning being required.
We'll have to do some profiling to see if not recalculating things makes up for the extra allocations.
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
I recently discovered this in #138574, when I fixed the bug for the main page, but the erroneous items were still in the sidebar.
If we simply collected a list of sidebar items during rendering of the main page, almost the entirety of
sidebar.rs
could be removed. This could even be done incrementally, with eachsidebar_*
function being replaced with a field onContext
.The text was updated successfully, but these errors were encountered: