[Bug 642967] [performance] Create variants of _ref/_unref for buffers

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Feb 22 09:26:07 PST 2011


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

Tim-Philipp Müller <t.i.m> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |t.i.m at zen.co.uk

--- Comment #2 from Tim-Philipp Müller <t.i.m at zen.co.uk> 2011-02-22 17:26:01 UTC ---
> The type check is of course a good thing to have to catch programmer errors.

Yes, this is all assuming that we think this type check is important enough
that we want to keep it by default even if it costs us some performance (I do
think so, fwiw).

The idea of having dedicated gst_{buffer,event,query}_{ref,unref} is that we
can then use  GST_IS_BUFFER() etc. which takes the cheaper code path by
default. Then we can either copy'n'paste the body of
gst_mini_object_{ref,unref} or chain up to an _unchecked() variant.

> How about having the type check be something like:
> 
>  gtype == GST_TYPE_BUFFER || g_type_check_instance_is_a (miniobjecttype)
> 
> Doing a quick check for the most common type and fall back to the slower check.
> The slow check would only happen for buffer subclasses.

This would be where then? in gst_mini_object_*() or gst_buffer_*()?

> you would indeed need a non-checking miniobject_unref and do the check in the
> gst_buffer_unref() method before you call the non-checking one, or something.

Alternatively of course we could just add the type == GST_TYPE_BUFFER || type
== GST_TYPE_EVENT || GST_IS_MINI_OBJECT (mo) to gst_mini_object_*(), which
wouldn't be pretty, but surely we'd find ways to numb our sense of disgust.

-- 
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