-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize RTP header extension handling #786
Conversation
…ations, us better container for two-bytes header extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don really know how that lib works but since tests pass I assume it's ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first observation here is that for 1-byte extensions there is a limit of 14, so it is way cheaper to just allocate contiguous space for 14 bytes as a static array rather than using red-black tree-based map from standard library. This provides huge savings on trivial temporary heap allocations.
For two-byte header extensions just more efficient data structure is used.
Yet another extract from
memory-optimizations
branch.Use
std::array
instead of a map for one byte extensions.