Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
Home

[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Justin Moore <justin@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Aug 2001 08:53:18 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Aug 21, 2001 at 07:13:07PM -0400, Justin Moore wrote:
> 
> > I'm still not convinced that an always sorted list is necessary. The
> > removal of this would simplify the code. The only place which uses
> > sorting is in server/savegame.c.
> 
>    A sorted list may not be necessary, but for data with infrequent
> inserts and frequent searches it is much faster.

Yes. But please show me these "frequent searches".

> Especially since genlist uses a horrendeously inefficient
> doubly-linked list.

>    I'll make a series of patches that convert a few of the genlists to
> sortlists and see how that changes the performance.

I would like to see this too. Maybe you can just rename genlist.[ch]
to old_genlist.[ch] and change the interface of your sortlist to match
the one of the old_genlist.

> I maintain that even if a sorted list is unnecessary, as long as it
> is not incorrect for the given data it is preferable.
> 
>    Also, what are people's thoughts about having the option of passing a
> function to sortlist_init() that would work the same way as the
> comparison function in qsort?

See above.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Q:  Do you know what the death rate around here is?
 A:  One per person.


[Prev in Thread] Current Thread [Next in Thread]