Repository navigation
perf: Improve preview cold generation - #65146
Open
CarlSchwan wants to merge 2 commits into
Open
CarlSchwan wants to merge 2 commits into
CarlSchwan wants to merge 2 commits into
Conversation
CarlSchwan
requested review from
Altahrim,
icewind1991,
provokateurin and
sorbaugh
and removed request for
a team
October 5, 2026 14:59
CarlSchwan
force-pushed
the
carl/preview-cold-generation
branch
from
October 5, 2026 15:25
ac57633 to
9a33f6c
Compare
When the max preview was just generated, its image is still in memory. Use it to resize the requested preview instead of reading the stored max preview back and decoding it again, which for a 12 MP photo takes a few hundred milliseconds. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
New preview sizes were always resized from the max preview, so each one paid for decoding and resampling the full resolution image. Use the smallest cached, uncropped preview that is still larger than the requested size as the source instead, e.g. the 256px grid view preview for the 64px list view one. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
CarlSchwan
force-pushed
the
carl/preview-cold-generation
branch
from
October 5, 2026 17:46
9a33f6c to
75b8b58
Compare
CarlSchwan
added this pull request to stack #65162
October 6, 2026 07:38
icewind1991
approved these changes
Oct 8, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
1st commit: reuse the generated max preview image
2nd commit: Don't generate progressive image for the big preview as it is then expensive to encode and decode. (potentially controversial as the image takes then slightly more space and render less smoothly)
3rd commit: resize from the smallest suitable cached preview to avoid reading the max preview when possible
Save: with GD cold list view 8.2 → 13.6 req/s, grid 15.8 → 18.8
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)