Skip to content

Parse fmtp lines once per codec search - #6

Merged
boks1971 merged 2 commits into
warp-4.2.18from
raja/fmtp-parse-once
Oct 6, 2026
Merged

boks1971 merged 2 commits into
warp-4.2.18from
raja/fmtp-parse-once

Conversation

@boks1971

@boks1971 boks1971 commented Oct 5, 2026

Copy link
Copy Markdown

Backport of pion/webrtc#3615.

getCodecs and SetCodecPreferences searched codecs in a loop. Each search parsed the fmtp lines of all media engine codecs again. Now each call parses them once. defaultClockRate and defaultChannels also use string matches instead of a map.

Benchmark with the 24 default video codecs (12 primary + 12 RTX), on this branch: getCodecs drops from about 60 µs, 152 KB and 1692 allocs to about 17 µs, 39 KB and 391 allocs.

🤖 Generated with Claude Code

getCodecs and SetCodecPreferences searched codecs in a loop, and each
search parsed the fmtp lines of all media engine codecs again. Parse
them once per call. Use string matches instead of maps for
defaultClockRate and defaultChannels.

Backport of pion#3615.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boks1971
boks1971 requested a review from a team October 5, 2026 20:11
@boks1971

boks1971 commented Oct 6, 2026

Copy link
Copy Markdown
Author

Merging this @cnderrauber and will tag it and pick it up. Have also filed a PR upstream for this.

@boks1971
boks1971 merged commit e5f5c3c into warp-4.2.18 Oct 6, 2026
14 of 17 checks passed
@boks1971
boks1971 deleted the raja/fmtp-parse-once branch October 6, 2026 05:05

@cnderrauber cnderrauber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you

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