Reducing memory allocations in read RTCP methods#185
Reducing memory allocations in read RTCP methods#185tyohan wants to merge 3 commits intopion:masterfrom
Conversation
|
Sorry I missed this @tyohan ! I added you to the org so you can create branches/dev easier. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #185 +/- ##
==========================================
+ Coverage 78.50% 79.05% +0.55%
==========================================
Files 22 22
Lines 2005 2072 +67
==========================================
+ Hits 1574 1638 +64
- Misses 336 339 +3
Partials 95 95
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
What happens if users don’t call I am 100% in support of performance changes, as long as they don’t impact existing users! |
|
Thank you for adding me to the org @Sean-Der So far from my understanding of sync.Pool, without release the packet or we don't put it back to the pool it will treated just like the current implementation. The memory will be release once there is no reference to it. But if it put back to the pool, it will reuse once there is a request to the new packet. I still trying to figure out what the best way to implement this without impacting the Pion API. I'll request more feedback from Pion slack channel. |
I'm profiling Inlive SFU to see how we can reduce the CPU usage and found out the ReadRTCP memory is keep allocating new memory for each RTCP packet and put a high pressure on the GC.
So I create a benchmark test on unmarshal method and to see if using sync.Pool and some other improvement can make a significant impact and the result comes with this below:
Before using sync.Pool
After using sync.Pool