Skip to content

perf(hdr): reduce layered composite overhead#538

Merged
vanceingalls merged 1 commit intomainfrom
vance/hdr-render-performance
Apr 28, 2026
Merged

perf(hdr): reduce layered composite overhead#538
vanceingalls merged 1 commit intomainfrom
vance/hdr-render-performance

Conversation

@vanceingalls
Copy link
Copy Markdown
Collaborator

Summary

  • instrument HDR layered compositing with per-stage timing buckets
  • switch HDR video frame extraction from PNG sequences to raw rgb48le files so the hot path does fixed-offset reads instead of PNG decode
  • skip exact-zero-opacity HDR blits and use a faster byte-level opacity blend path for rectangular rgb48le layers
  • add alpha blit coverage for opacity blending and zero-opacity no-op behavior

Performance

Local HDR benchmark (bun run benchmark -- --tags hdr --runs 1):

  • before: 368.7s combined (hdr-hlg-regression 102.6s, hdr-regression 266.1s)
  • after: 281.8s combined (hdr-hlg-regression 67.9s, hdr-regression 213.9s)
  • net: ~24% faster combined

Validation

  • bun run --filter @hyperframes/engine typecheck
  • bun run --filter @hyperframes/producer typecheck
  • vitest run src/utils/alphaBlit.test.ts
  • vitest run src/services/renderOrchestrator.test.ts
  • bunx oxlint packages/engine/src/utils/alphaBlit.ts packages/engine/src/utils/alphaBlit.test.ts packages/producer/src/services/renderOrchestrator.ts
  • bunx oxfmt --check packages/engine/src/utils/alphaBlit.ts packages/engine/src/utils/alphaBlit.test.ts packages/producer/src/services/renderOrchestrator.ts
  • git diff --check

Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after reviewing the HDR compositing changes on head 9ce0da2. I checked the raw rgb48le extraction/read path, opacity blit changes, cleanup behavior, and perf reporting, and validated with targeted unit/type/lint checks plus the HLG HDR regression fixture. CI is green, including the HDR regression shard.

@vanceingalls vanceingalls merged commit ad44c31 into main Apr 28, 2026
37 checks passed
@vanceingalls vanceingalls deleted the vance/hdr-render-performance branch April 28, 2026 22:30
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