Repository navigation
[Improve] Reduce per-packet quality sampling overhead - #7997
Open
antmedia-roomote-ai[bot] wants to merge 1 commit into
Open
antmedia-roomote-ai[bot] wants to merge 1 commit into
antmedia-roomote-ai[bot] wants to merge 1 commit into
Conversation
Author
This branch has not been deployed
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 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.