Skip to content

repository stats: reduce memory usage in regular stats update - #3653

Merged
syphar merged 1 commit into
rust-lang:mainfrom
syphar:repo-stats-batch
Oct 30, 2026
Merged

syphar merged 1 commit into
rust-lang:mainfrom
syphar:repo-stats-batch

Conversation

@syphar

@syphar syphar commented Oct 30, 2026

Copy link
Copy Markdown
Member

We can stream the query result and directly batch it, no need to store everything in advance.

Also, use a db transaction to make the updates faster. Only one commit in the db is faster than one per query. We can optimize this even further by creating a single sql statement for all deletes & all updates, but not for now.

Not a problem yet, but I saw it and wanted to fix it before I forget.

@syphar syphar self-assigned this Oct 30, 2026
@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 30, 2026
@syphar
syphar marked this pull request as ready for review October 30, 2026 11:36
@syphar
syphar requested a review from a team as a code owner October 30, 2026 11:36
@syphar
syphar merged commit ace16dd into rust-lang:main Oct 30, 2026
12 checks passed
@syphar
syphar deleted the repo-stats-batch branch October 30, 2026 15:54
@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 Oct 30, 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 — a99983f2 Deployed Oct 30, 2026 by syphar via deploy #847
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