payloaders: memory performance
@mparisdiaz
Submitted by Miguel París Díaz Link to original bug (#754189)
Description
Hello,
I have done some profiling about some payloaders and I have realized that an important CPU percentage is used for memory management:
1 - allocating and freeing RTP buffers
2 - mapping/unmapping RTP buffers
Possible solutions to improve efficiency:
1 - Could we use a kind of buffer pool instead of creating new buffers and freeing again and again?
2 - Could be a way of improve mapping/unmapping of RTP buffers?
---- PROFILE REPORT ----
VP8 payloader:
gst-launch-1.5 videotestsrc num-buffers=100 ! vp8enc ! rtpvp8pay ! fakesink enable-last-sample=false
Percentages of usage (with gst_rtp_base_payload_chain as root):
100 - gst_rtp_base_payload_chain (ir per call: 15283)
98.67 - gst_rtp_vp8_pay_handle_buffer
7.29 - gst_buffer_copy_region
4.18 - gst_buffer_append
29.67 - gst_rtp_vp8_create_header_buffer
17.94 - gst_rtp_buffer_new_allocate
14.57 - gst_rtp_buffer_allocate_data
3.16 - gst_buffer_new
35.24 - gst_rtp_base_payload_push_list
8.96 - gst_rtp_base_payload_prepare_push
6.65 - set_headers
4.24 - gst_rtp_buffer_map
1.42 - gst_rtp_buffer_unmap
22.41 - gst_base_sink_chain_list
12.38 - gst_mini_object_unref
7.13 - _gst_buffer_list_free
3.94 - _gst_buffer_free
OPUS payloader
gst-launch-1.5 audiotestsrc num-buffers=1000 ! opusenc ! rtpopuspay ! fakesink enable-last-sample=false
Percentages of usage (with gst_rtp_base_payload_chain as root):
100 - gst_rtp_base_payload_chain
96.62 - gst_rtp_opus_pay_handle_buffer
8.38 - gst_buffer_append
22.56 - gst_rtp_buffer_new_allocate
16,83 - gst_rtp_buffer_allocate_data
5.31 - gst_buffer_new
63.42 - gst_rtp_base_payload_push
16.40 - gst_rtp_base_payload_prepare_push
12.98 - set_headers
8.04 - gst_rtp_buffer_map
2.92 - gst_rtp_buffer_unmap
37.62 - gst_base_sink_chain
20.98 - gst_mini_object_unref
18.97 - _gst_buffer_free
Version: 1.5.2