Skip to content

improve source browser performance with big source archives - #3658

Merged
GuillaumeGomez merged 2 commits into
rust-lang:mainfrom
syphar:faster-content
Nov 2, 2026
Merged

GuillaumeGomez merged 2 commits into
rust-lang:mainfrom
syphar:faster-content

Conversation

@syphar

@syphar syphar commented Oct 31, 2026

Copy link
Copy Markdown
Member

The super high server load today got me to look into where certain endpoints spend time again.

And one thing was odd:
image

This is happening when our source-browser inspects the list of files in the source archive to generate the directory listing.

There seem to be crates where the source archive has >10k files:

           name           |   version   | source_file_count
--------------------------+-------------+-------------------
 shrust                   | 0.0.4       |             80827
 skia-bindings            | 0.14.2      |             63739
 skia-bindings            | 0.17.0      |             62966
 skia-bindings            | 0.15.0      |             62344
 skia-bindings            | 0.16.0      |             62344
 skia-bindings            | 0.14.4      |             62344
 shrust                   | 0.0.3       |             57486
 tsrun                    | 0.1.16      |             56217
 tsrun                    | 0.1.15      |             56217

Using these I wrote a benchmark, and could reproduce the issue when I had parallel clients on the same sqlite db.

So I changed the logic so we're using sqlite functions to do the work:

 With 16 concurrent readers, time until all finish:

   Listing          Before    After
  ━━━━━━━━━━━━━━━  ━━━━━━━━  ━━━━━━━
   Root             1.16 s    51 ms
  ───────────────  ────────  ───────
   Nested folder    252 ms    34 ms

or even faster.

@syphar
syphar requested a review from a team as a code owner October 31, 2026 01:00
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Oct 31, 2026
@syphar

syphar commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

r? @GuillaumeGomez

@GuillaumeGomez
GuillaumeGomez merged commit b169956 into rust-lang:main Nov 2, 2026
12 checks passed
@GuillaumeGomez

Copy link
Copy Markdown
Member

Nice, thanks!

@GuillaumeGomez
GuillaumeGomez deleted the faster-content branch November 2, 2026 10:21
@github-actions github-actions Bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Nov 2, 2026
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Nov 2, 2026

This branch was previously deployed

1 inactive deployment
github-pages — 81097da8 Deployed Nov 2, 2026 by GuillaumeGomez via deploy #875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants