[gstreamer-bugs] [Bug 599870] [API] micro-optimisation: add GST_DEBUG_FUNCPTR_FULL

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Oct 28 02:13:41 PDT 2009


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

--- Comment #7 from Sebastian Dröge <slomo at circular-chaos.org> 2009-10-28 09:13:38 UTC ---
(In reply to comment #4)
> Yes, I'm talking about sane RW locks :) Also, didn't you write a patch to let
> the RW locks use the pthread RW locks because of this? :P

Also you could use #ifdef HAVE_PTHREAD a pthread RW lock implementation inside
gstinfo.c for that hash table, use GStaticRWMutex if GLib new enough and
contains your patch and otherwise continue to use the broken normal mutex
otherwise.

(In reply to comment #6)
> Depends on whether the issue was primarily contention (doubtful?) or the hash
> table lookups I guess.

I was expecting that contention was the problem here. Hash table lookups should
be rather fast in this case, it should more or less just be

somearray[(funcptr % somevalue)] and check if the pointers are equal (*)

If there are multiple function pointers mapped to the same bucket this would
just be another (very few) indirections through a linked list (chained hash
table implementation) or some more of (*) (open addressing).



Another source of overhead would be the static mutex implementation btw, Edward
said it's very inefficient too... so maybe a GMutex instead of a GStaticMutex
would help too.

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