-
-
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
ObjectPoolAllocator #903
base: v3
Are you sure you want to change the base?
ObjectPoolAllocator #903
Conversation
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.
Just a few things reviewed yet
NOTE: Currently measuring the CPU time differences with pools VS new/delete. |
Converted to draft while re-testing re-profiling. Feel fee to try it out and review. |
@Hartigan please send multiple comments as a review together rather than individually, it will reduce number of GitHub notifications everyone receives. |
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.
Some cosmetic changes requested and a question. Other than that it looks very good however I'm not in a good shape to properly review these huge changes, but I trust you guys.
Which is the status of this PR? |
It's ready to merge. It's working properly. Even though we may want to enrich he pool allocator in the future is a good starting point. |
Ok? |
Reminder: this PR needs love. |
Yes, it's on my TODO |
I'll revive this PR for the new year. |
Guys, back to this topic. I see the benefits of using an object allocator in favour of My opinion here is keeping the branch for future consultation, and spend the proper time on a solution with which we feel more confortable when the need for this performance enhancement comes. My personal experience here is that using a different allocator such us jemalloc increases substantially the performance out of the box. I know these are two different topics, but anyone could use an alternative allocator transparently, according to their needs. |
Hi @jmillan I agree, I have good experience with Thanks |
This is an extract from a bigger "Memory Optimizations" PR #675
It contains only the
ObjectPoolAllocator
part with a few exceptions:RtpPacket::Parse()
does return aRtpPacket
instance. In Memory optimizations #675 it returned a shared pointer but since shared pointers are just needed for cloned packets (for retransmission), the former method does not need to create one.RtcpCompoundPacket
is left as it was. This is, a new one is created when needed (this will be enhanced in a separate PR).As per my tests I'm not seeing much difference with this and v3. There is maybe some noticeable CPU enhancement.
Please @nazar-pc , @Hartigan give it a try and instrument this if possible to see how it enhances comparing to v3. I'll do some more testing just to make sure this addition is worth it.
Performed performance unit tests:
ObjectPoolAllocator is definitely more performant as it reuses memory instead of freeing & re-allocating it.