After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750149 - queuearray: allow storing of structs in addition to pointers (for GQueue optimisation)
queuearray: allow storing of structs in addition to pointers (for GQueue opti...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-30 14:29 UTC by Tim-Philipp Müller
Modified: 2015-08-16 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
queuearray: allow storing of structs in addition to pointers (16.50 KB, patch)
2015-05-30 14:29 UTC, Tim-Philipp Müller
committed Details | Review
queue: avoid slice allocs/frees for each item (6.96 KB, patch)
2015-05-30 14:30 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2015-05-30 14:29:14 UTC
Created attachment 304310 [details] [review]
queuearray: allow storing of structs in addition to pointers

This way we don't have to allocate/free temporary structs for storing things in the queue array.
Comment 1 Tim-Philipp Müller 2015-05-30 14:30:22 UTC
Created attachment 304311 [details] [review]
queue: avoid slice allocs/frees for each item

Let GstQueueArray store our item struct. That way we don't have to alloc/free temporary QueueItem slices for every item we want to store in the queue.
Comment 2 Tim-Philipp Müller 2015-05-30 15:57:59 UTC
We could possibly also re-use most of the old functions and just interpret the gpointer data pointer differently if the QueueArray was created for a struct, then we only need the new _new() function and the drop_struct() one (or not even that, since GstQueue doesn't need _drop). That's not very nice though IMHO.
Comment 3 Tim-Philipp Müller 2015-07-04 15:40:58 UTC
commit 41fdf21a60ca69bdc90bef367fbce41dcf4415ad
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sat May 30 14:27:05 2015 +0100

    queue: avoid slice allocs/frees for each item
    
    Microoptimisation: Let GstQueueArray store our
    item struct. That way we don't have to alloc/free
    temporary QueueItem slices for every item we want
    to put into the queue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750149

commit d0f85838ab789f8b0e0075c1818eca8d35d43133
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sat May 30 13:07:50 2015 +0100

    queuearray: allow storing of structs in addition to pointers
    
    This way we don't have to allocate/free temporary structs
    for storing things in the queue array.
    
    API: gst_queue_array_new_for_struct()
    API: gst_queue_array_push_tail_struct()
    API: gst_queue_array_peek_head_struct()
    API: gst_queue_array_pop_head_struct()
    API: gst_queue_array_drop_struct()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750149