Skip to content

Reduce Media Studio payloads and redundant reads - #27

Merged
gateway merged 18 commits into
mainfrom
codex/media-performance
Oct 14, 2026
Merged

gateway merged 18 commits into
mainfrom
codex/media-performance

Conversation

@gateway

@gateway gateway commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

 Media Studio
- full catalogs and heavy job props at startup
+ route-specific data, bounded workflow summaries, compact preset and job-card props
- repeated page reads and offset rescans
+ scoped in-flight sharing, server-seed reuse and gallery continuations
- Graph media list preloads for restoration
+ exact selected-media reads and bounded fresh picker pages

Preserve existing API defaults, saved-state contracts, pricing, refresh/retry and original-media previews. Add opt-in summary/cursor paths; keep legacy full-list and offset consumers working. Includes template catalog reuse and visible gallery recovery errors.

Evidence

Representative separate paired development comparisons, each with five serial warm samples; these are not one cumulative benchmark:

Scenario Before After
Graph startup target reads 11 4
Workflow catalog body across startup + first open 2,162,802 B 14,125 B
Workflow dialog DOM elements 5,078 1,194
Studio decoded document 3,372,797 B 2,780,708 B
Settings decoded RSC 1,215,417 B 90,734 B
Studio preset initial client list reads 2 1
Admin redundant preset reads after server seed 2 0
Gallery backend calls at append offsets 42 / 102 / 498 1 / 2 / 5 1 / 1 / 1
Graph closed-picker decoded metadata 410,614 B 83,274 B
Jobs decoded RSC 2,225,475 B 149,284 B (−93.29%)
  • Before: template normalization repeatedly rebuilt catalogs; gallery overlap repeated page payloads. After: isolated contract tests verify once-per-request catalog reuse and freshness; matched gallery traversal eliminates 126,375 redundant decoded bytes while preserving ordered results.
  • Before: broad Graph restoration lists omitted older selected media. After: selected previews restore through exact detail reads. Boot HTTP count rises from 3 lists to 12 details; first picker opens remain unchanged and fresh reopens make no metadata reads. This is not a total-image-traffic reduction claim.
  • Settings loader reads fall 19→3, but complete capture brackets include independent gallery traffic (19–20→4). Jobs retains all 19 backend reads and 2 development runtime GETs; only card-boundary props change. Cursor responses add 167–168 bytes, while returned backend rows at the measured offsets fall 100/212/548→12 each; SQL scan work is unmeasured.
  • Focused checks cover response compatibility/freshness, duplicate and stale page ownership, refreshed seeds, retry/error recovery, dirty-tab and delayed-preview preservation, tied cursor ordering, exact-media restoration/import invalidation, and pricing/prompt projection contracts. Slice-level focused tests and applicable typecheck/lint/file-size/diff checks passed; final Jobs projection adds five pure contract tests. Independent full cumulative Standards and Spec reviews report zero actionable source findings.
  • Browser acceptance verifies ordered cards, bounded paging/search, preserved controls/defaults, exact previews, visible failure/retry and original draft/storage restoration. Live conditional pricing/runtime and multi-output Jobs cases were unavailable; contract/source coverage is separate from live proof.
  • Memory/canvas and historical Jobs latency investigations produced qualified diagnostics, not additional optimization claims. Retainer/process/GPU, reliable active frames, comparable retention repeats and production coverage remain incomplete. Development timings do not establish causal speedups, leak freedom or a fix for the historical slow sample.

All four hosted CI checks passed on 6059967: publication safeguards, Windows onboarding, assistant mechanical contracts, and the full quality gate. The quality-gate run passed 993 backend tests, 1,120 web tests across 182 files, lint, type checking, the production build and Studio browser smoke. Fixtures ran only in the authorized ephemeral GitHub-hosted environment; no broad local suites or local production build were run. A successful hosted build/smoke is not a production performance benchmark. Private raw captures are intentionally excluded.

Merge Danger

Door: two-way

Source reverts restore prior behavior; no database migrations or destructive data changes. Legacy full-list/timestamp/offset contracts remain available. Roll back coherent frontend/backend cursor or summary slices together.

Blast Radius: cross-stack

Touches Studio gallery/presets, Graph startup/workflow browsing/media selection, General Settings and Jobs card serialization, plus additive backend projections/cursors. Primary risks are stale request ownership, hydration/default preservation, tied pagination order and pricing display fallback. Focused regressions and paired browser checks cover these paths; production and disclosed live-data cases still require follow-up. No merge, deployment or paid-generation approval is implied.

@gateway
gateway marked this pull request as ready for review October 14, 2026 08:09
@gateway
gateway merged commit 58d1547 into main Oct 14, 2026
4 checks passed
@gateway
gateway deleted the codex/media-performance branch October 14, 2026 08:10
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.

1 participant