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



On Fri, Oct 06, 2000 at 10:37:13AM +0200, Andrew Bartle / 93011 wrote:
> The user wants an interface to a fast list, even if that means exposing an
> interface object and hiding the beautiful symmetry.

Actually not really.  If you want to do scheme/lisp style list recursion, you
NEED a symetric list structure.  And not just for that.  You also need it for
storing an iterator as a list.  With your method you'd have to add an
iterator, which would add a lot of overhead and code to glib, and break
things.  I could see a point for a wrapper object for the case where you want
a fast appending list.  And apparently that's just what GQueue is.

> Do you use g_list_append() or g_slist_append() in other components
> based on GList or GSList, such as GNode and Hash Tables ?
> 
> As you may have guessed, performance is VERY important to us and was one of the
> reasons for giving glib a try.

There is nothing wrong with GList really.  All you need is to store two
pointers for now, and write an append function that uses and updates those
two pointers.  You loose nothing.

GList is just incredibly simple.  And it's semantics are very predictable,
this is what makes it even more useful.

George

-- 
George <jirka 5z com>
   I either want less corruption, or more chance to participate in it.
                       -- Ashleigh Brilliant




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