perf(share): cuts share card generation cost - #3148
Open
seferturan wants to merge 3 commits into
Open
Conversation
|
|
Overall Grade |
Security Reliability Complexity Hygiene Coverage |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Aug 18, 2026 11:16a.m. | Review ↗ | |
| Code coverage | Aug 18, 2026 11:16a.m. | Review ↗ |
Code Coverage Summary
| Language | Line Coverage (Overall) |
|---|---|
| Aggregate | 69% [▲ up 0.1% from main] |
| Javascript | 69% [▲ up 0.1% from main] |
➟ Additional coverage metrics may have been reported. See full coverage report ↗
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
sveltekit-og fetches NotoSans regular and bold from cdn-sveltekit-og.ethercorps.io on every cold generation. Sentry has that pair at 6s to 19s across the past week, which is long enough for a social scraper to give up before the card renders, and it puts a third party in the critical path of every share image. Reads both faces from the R2 bucket the endpoint already binds, memoised per isolate. Falls back to the sveltekit-og defaults when the bucket or an object is missing, so dev keeps working and a bad upload degrades instead of breaking. Needs assets/fonts/NotoSans-Regular.ttf and assets/fonts/NotoSans-Bold.ttf uploaded to walter before this has any effect.
Satori render time on the poster shadow, averaged over three samples per variant: the five layer stack cost ~783ms on open-graph and ~1413ms on feed, against ~538ms and ~764ms for one layer. That is 31% and 46% off the render. Cost tracks the area the blur covers, not the number of layers, so alpha is free. Keeping it low matters: a single layer at 0.5 alpha concentrates the whole shadow into a visible slab with a hard edge along the poster radius, where five faint layers blended into a smooth falloff. 0.22 over a 32px blur reads like the original without the cost.
Both were awaited in sequence even though neither depends on the other, so the request paid for both round trips back to back. Neither can reject, they both degrade internally, so Promise.all does not change the failure behaviour.
seferturan
force-pushed
the
perf/share-fonts-from-r2
branch
from
August 18, 2026 11:16
d6c9462 to
68d9723
Compare
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.
🎶 Notes 🎶
cdn-sveltekit-og.ethercorps.ioon every cold generation, 6s to 19s in Sentry over the past week, which is long enough for a scraper to give up before the card rendersassets/fonts/NotoSans-Regular.ttfandassets/fonts/NotoSans-Bold.ttffrom the walter bucket the endpoint already binds, memoised per isolatePromise.alldoes not change the failure behaviour🚀 Deploying 🚀
🤔 Later 🤔