load crate menu contents on demand #1772
Labels
A-frontend
Area: Web frontend
C-enhancement
Category: This is a new feature
E-medium
Effort: This requires a fair amount of work
Most page navigations don't result in opening the crate menu. We could load that menu using JS, either immediately after page load or on click / hover.
That would simplify #1560 because a page's HTML wouldn't depend on the list of crate versions and yanked versions.
It would also, I believe, result in an improvement in performance, reducing database load and wall clock time to load rustdoc pages.
Right now, every page load invokes this JOIN query across
releases
,crates
,doc_coverage
, andrepositories
:docs.rs/src/web/crate_details.rs
Lines 90 to 129 in 19b354a
releases
andcrates
.Each page load also does a query across
owners
andowner_rels
, which doesn't need to be done at page load time:docs.rs/src/web/crate_details.rs
Lines 207 to 213 in 19b354a
This query in
releases_for_crate
, across thereleases
table (with no LIMIT) could also be avoided at page load time:docs.rs/src/web/crate_details.rs
Lines 247 to 260 in 19b354a
So I think the net result would be replacing three queries (two of them using JOINs) with a single, simple query with a single result.
The text was updated successfully, but these errors were encountered: