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: Markus Linnala <maage@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Aug 2001 21:49:52 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Aug 20, 2001 at 10:19:06PM +0300, Markus Linnala wrote:
> Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > find_genlist_position() does the right thing for -1. So there is only
> > the overhead of one (find_genlist_position) function call.
> 
> That overhead of one function call is not negligible. More than
> 3%.

The 3% doesn't convince me but this one:
-----------------------------------------------
                0.00    0.00     632/8136906     genlist_get [566]
                0.34    0.00 8136274/8136906     genlist_iterator_init [42]
[77]     1.6    0.34    0.00 8136906         find_genlist_position [77]
-----------------------------------------------

And a lot if not all calls to genlist_iterator_init have a position of
0 or -1.  So I would vote for a genlist_iterator_init_from_head and a
genlist_iterator_init_from_tail.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  reality.sys corrupt. Reboot Universe? (y,n,q)


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