Skip to content

[Improve] Reduce per-packet quality sampling overhead - #7997

Open
antmedia-roomote-ai[bot] wants to merge 1 commit into
masterfrom
fix/mux-quality-window-1dbrwtzm1dqgy
Open

antmedia-roomote-ai[bot] wants to merge 1 commit into
masterfrom
fix/mux-quality-window-1dbrwtzm1dqgy

Conversation

@antmedia-roomote-ai

Copy link
Copy Markdown

Opened on behalf of Balazs Jantek. View the task or mention @roomote for follow-up asks.

What changed

Replaced MuxAdaptor's per-packet concurrent linked deque with a synchronized, fixed-size primitive ring buffer for quality samples. Reporting-only queue/drop reads and speed rounding now run only when a quality or webhook report is due. The diagnostic sample getter returns an ordered detached snapshot.

Why this change was made

The previous 300-packet window called ConcurrentLinkedDeque.size() for every accepted packet, adding linear traversal and allocation pressure on a profiling hot path. Coordinated rollover and concurrent snapshot coverage protect the bounded window's behavior.

The focused MuxAdaptor regression test passes. The full Maven suite reached 111 tests with no assertion failures but could not run two Docker/Testcontainers-dependent tests because no Docker environment was available.

Impact

Streaming quality speed calculations retain the existing oldest-to-newest sample-window semantics while avoiding linked-node allocation and O(n) capacity checks per packet. No user-visible UI behavior changes.

@antmedia-roomote-ai

antmedia-roomote-ai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Author

No code issues found. See task

Reviewed 9bbad9e

This branch has not been deployed

No deployments
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