Re: [Fwd: glib::GList:g_list_append(), g_list_last() performance problem]



Andrew Bartle / 93011 <a_bartle stest ch> writes: 
> Where is GQueue ? Its not in glib as documented in
> [[http://developer.gnome.org/doc/API/glib/index.html]]
> 
> Neither is it in glib.h and I couldn't find it by searching
> [[http://www.gnu.org/cgi-bin/htsearch]]
>

It's in the next version of GLib, but not in 1.2.
  
> The user wants an interface to a fast list, even if that means exposing an
> interface object and hiding the beautiful symmetry.
> 

It's a totally academic argument, because lots of existing code would
break by modifying GList this way. So it can't be changed. In the next
version there is GQueue which can be used as an alternative, in the
current version you can do your own caching.

> Do you use g_list_append() or g_slist_append() in other components
> based on GList or GSList, such as GNode and Hash Tables ?
>

Only when its O(n) complexity is not an issue. append() is defined to
be O(n) and as such shouldn't be used when that matters.

Havoc






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]