-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed stream list to arrays and moved its code to a separate file.
The stream list in the SRTP context is now implemented with two arrays: an array of SSRCs and an array of pointers to the streams corresponding to the SSRCs. The streams no longer form a single linked list. Stream lookup by SSRC is now performed over the array of SSRCs, which is faster on large number of SSRCs because it is more cache-friendly. This opens up the further possibility to optimize the lookup by using vector instructions, which will follow in a separate commit. Expected performance of stream lookup compared to the previous list-based implementation: SSRCs speedup (scalar) 1 0.39x 3 0.57x 5 0.69x 10 0.77x 20 0.86x 30 0.87x 50 1.13x 100 1.25x 200 1.30x Performance tested on an Intel Core i7 2600K CPU. At small numbers of SSRCs the new algorithm is somewhat slower, but given that the absolute and relative times of the lookup are very small, that slowdown is not very significant.
- Loading branch information
Showing
7 changed files
with
418 additions
and
133 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,7 @@ endif() | |
|
||
set(SOURCES_C | ||
srtp/srtp.c | ||
srtp/stream_list.c | ||
) | ||
|
||
set(CIPHERS_SOURCES_C | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,7 @@ endif | |
|
||
sources = files( | ||
'srtp/srtp.c', | ||
'srtp/stream_list.c', | ||
) | ||
|
||
ciphers_sources = files( | ||
|
Oops, something went wrong.