Skip to content

Inline GstStructure

Edward Hervey requested to merge bilboed/gstreamer:wip-structure-inline into master

Part of #519

This series of commits effectively transforms GstStructure from:

  • One allocation for GstStructure
  • One allocation for GArray
  • One allocation for the actual array in GArray

To:

  • At best a single allocation for all content
  • At worst (when memory increases beyond the pre-allocated data) 2 allocations

Furthermore when creating structures via the various valist creation function it will calculate an optimal pre-allocated size.

Capsnego benchmark

Before patch:

0:00:00.014263101 built pipeline with 607 elements 0:00:03.532530124 reached PAUSED state (50 loop iterations)

0:00:00.014646325 built pipeline with 607 elements 0:00:03.479876432 reached PAUSED state (50 loop iterations)

0:00:00.014641546 built pipeline with 607 elements 0:00:03.551046282 reached PAUSED state (50 loop iterations)

0:00:00.014310300 built pipeline with 607 elements 0:00:03.591054887 reached PAUSED state (50 loop iterations)

Average: 0.0145 built pipeline Average: 3.5386 reached PAUSED

After patch:

Average: 3.3323 reached PAUSED Diff: 0.2063

With this patch, the capsnego benchmark is 5.8% faster

Edited by Edward Hervey

Merge request reports