Skip to content
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

srtp_get_stream is O(n) #417

Open
JonathanLennox opened this issue Jul 11, 2018 · 2 comments
Open

srtp_get_stream is O(n) #417

JonathanLennox opened this issue Jul 11, 2018 · 2 comments

Comments

@JonathanLennox
Copy link

LibSRTP stores every ssrc's srtp_stream_ctx_t in a linked list. This means that finding the appropriate context for an ssrc is an O(n) operation. In a large conference, this can be a noticeable performance cost.

A hash table would probably be the best option here.

@paulej
Copy link
Contributor

paulej commented Jul 11, 2018

Fully agree. The SSRC lookup can be painfully slow if there are lot of them. Since these are (in theory) supposed to be random values, a tree might prove to be fairly well balanced most of the time without much effort.

@murillo128
Copy link

We have extracted the current stream list implementation and create an internal api + default linked list implementation in the following PR #612

While this does not allow to plug-in a custom implementation dynamically, it allows compiling libsrtp without the default list implementation and replace it with a custom one instead.

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

No branches or pull requests

4 participants