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: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
From: Justin Moore <justin@xxxxxxxxxxx>
Date: Tue, 21 Aug 2001 19:13:07 -0400 (EDT)

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

-jdm

Department of Computer Science, Duke University, Durham, NC 27708-0129
Email:  justin@xxxxxxxxxxx



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