Skip to content

WIP: basetransform: Only intersect caps when needed

Edward Hervey requested to merge bilboed/gstreamer:basetransform into master

A lot of elements are going to return proper caps which are subsets of what they can handle (subset of their template caps). Instead of penalizing everybody with expensive caps intersection (both in terms of cpu and memory), first check whether the caps are already valid.

capsnego benchmark

(average of 4 runs)

before after diff % of before
reached PAUSED state 2.145 1.9716 - 0.1734 92
heaptrack: allocations 45357603 32609210 - 12748393 72
heaptrack: temporary allocations 42894 53082 + 10188 124

mass nego

GST_REGISTRY_UPDATE=no time gst-launch-1.0 videotestsrc num-buffers=1 ! { 42 x videoconvert } ! autovideosink

Average of 4 runs

before after diff % of before
time user 0.78 0.46 0.32 59
time elapsed 0.9 0.55 0.35 61
heaptrack: allocations 4133956 2468346 1665610 60
heaptrack: temporary allocations 43463 37757 5706 87

Merge request reports