Description
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
, and repositories
:
docs.rs/src/web/crate_details.rs
Lines 90 to 129 in 19b354a
releases
and crates
.
Each page load also does a query across owners
and owner_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 the releases
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.