Skip to content

perf(dgw): avoid cloning decoded frames - #1955

Open
Benoît Cortier (CBenoit) wants to merge 1 commit into
masterfrom
cbenoit-improve-gateway-performance
Open

perf(dgw): avoid cloning decoded frames#1955
Benoît Cortier (CBenoit) wants to merge 1 commit into
masterfrom
cbenoit-improve-gateway-performance

Conversation

@CBenoit

Copy link
Copy Markdown
Member

Re-encoding cloned each decoded video frame after extracting it. Move the sole frame out of the collection to avoid that allocation and copy.

Re-encoding cloned each decoded video frame after extracting it.\nMove the sole frame out of the collection to avoid that allocation\nand copy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 26, 2026 07:25
@CBenoit

Copy link
Copy Markdown
Member Author

Implementation notes:

  • Moves the sole decoded frame out of the temporary vector after the non-lacing invariant is checked.
  • Preserves frame bytes and parsing behavior while removing one full-frame allocation and copy per re-encoded frame.
  • Adds SimpleBlock extraction coverage.

Validation:

  • cargo +nightly fmt --all
  • cargo clippy --workspace --tests -- -D warnings
  • cargo test -p video-streamer

Note

Human-tuned, LLM-assisted content.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Optimizes video frame extraction by moving the sole decoded frame instead of cloning it.

Changes:

  • Replace frame cloning with Vec::pop.
  • Add a SimpleBlock extraction test.
  • No material issues identified.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants