perf(producer): revert webp extraction default (20x slower than jpg on this host)#441
Closed
jrusso1020 wants to merge 1 commit intoperf/producer-stack-cleanupfrom
Closed
perf(producer): revert webp extraction default (20x slower than jpg on this host)#441jrusso1020 wants to merge 1 commit intoperf/producer-stack-cleanupfrom
jrusso1020 wants to merge 1 commit intoperf/producer-stack-cleanupfrom
Conversation
This was referenced Apr 23, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3 tasks
Collaborator
Author
|
Closed: only existed to revert #434; both drop from the rebuilt stack. See hyperframes-notes/perf-stack-rebuild-plan-2026-04-23.md |
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.

What
Reverts
renderOrchestrator.ts's explicitformat: "webp"on the producer's singleextractAllVideoFramescall. The extractor now falls back to its default ("jpg").Keeps everything else from PR #434 intact:
ExtractionOptions.formatstill accepts"webp", the injector'smimeTypeForFramePathstill routes.webp→image/webp, and the cache schema bump (v1→v2) stays.Why
Caught by running the architecture review's validation plan (
hyperframes-notes/producer-render-architecture-review-2026-04-21.md§ Validation plan) against real fixtures after/simplify.Numbers on
vfr-screen-recording(3s @ 30fps, 480×332, 90 frames):videoExtractMstotalElapsedMsformat: "webp"format: "jpg"Direct ffmpeg comparison on the same clip isolates libwebp as the culprit:
-q:v 2(jpg, libjpeg-turbo)-c:v libwebp -quality 95 -lossless 0-c:v libwebp -quality 80 -lossless 0libwebp runs multi-pass analysis to minimize bits; libjpeg-turbo is single-pass SIMD-optimized. For synthetic/gradient content (testsrc, screen recordings, UI-heavy comps), the per-byte compression win is marginal (32KB webp vs 33KB jpg in my measurement) but the encode cost is enormous.
The architecture review's WebP suggestion was premised on "collapsing an
if (hasAlpha)branch in extraction and injection." This codebase's extractor already defaults to JPG with no alpha branch in the producer's call site — so the unification benefit is theoretical, and the encode cost is real.How
Single-line change: drop
format: "webp"from the producer's extract options. Adds an explanatory comment pointing at the validation-plan finding.All other PR #434 infrastructure stays:
"webp"remains a validExtractionOptions.formatvalue, the extractor's libwebp branch works, the injector correctly tags webp data URIs, the cache schema is still v2 (preventing cross-contamination with any legacy v1 jpg entries).Test plan
vfr-screen-recording:videoExtractMs: 247ms(down from 1365ms, back within ~17% of origin/main's 211ms — remaining delta is instrumentation overhead plus the segment-scoped VFR preflight).Stack
Tip of the perf stack: #430 → #432 → #433 → #434 → #435 → #437 → #441.
Follow-ups
format: "webp"per-composition.