[Bug 731756] New: gstvalue: Speed up gst_value_intersect/_subtract

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jun 16 22:56:04 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=731756
  GStreamer | gstreamer (core) | unspecified

           Summary: gstvalue: Speed up gst_value_intersect/_subtract
    Classification: Platform
           Product: GStreamer
           Version: unspecified
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: bilboed at bilboed.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Both gst_value_intersect and gst_value_subtract will call
gst_value_compare if one of their arguments isn't a list.

gst_value_compare will then re-do a check to see if one of
the arguments is a list (for the special case of comparing a unitary
value with a list of length 1).

The problem is that the various G_VALUE_HOLDS represent an expensive
amount of calling gst_value_compare (almost half of it) to see if
the provided arguments are list. These checks can be done without
when we know that the arguments aren't lists.

* Create a new "pure" gst_value_compare which avoids that special
  case comparision

Benchmarks:
 valgrind/callgrind: average speedup in instruction calls for
 gst_value_intersect and gst_value_subtract is around 56% (Makes 63%
 of the calls it used to take previously)

 tests/benchmarks/capsnego: With default settings (depth 4, children 3
 607 elements), time taken for transition from READY to PAUSED:
   Before : 00.391519153
   After  : 00.220397492
    56% of the time previously used, +77% speedup

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list