Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Unused field in move_cost_map removed. (PR#964)
Home

[Freeciv-Dev] Unused field in move_cost_map removed. (PR#964)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Unused field in move_cost_map removed. (PR#964)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Tue, 18 Sep 2001 04:39:39 -0700 (PDT)

I did some experimenting with the returned field of move_cost_map (aka
warmap),
http://www.freeciv.org/lxr/source/server/gotohand.h?v=cvs#L38

It's intended use was to indicate to the warmap generator that a location
has already been processed.  However, by virtue of Dijkstra's algorithm,
such an occurence is quite rare.  This is probably the reason why it is
not quite used (although initialised) in the currecnt code.  

I tried following things: check for "returned" disabled (that's current
code), check enabled and also plain removing all mentions of this
"returned" field.  The savegames from the runs were identical in all
cases (expected). The results of timing the test runs were:

With warmap.returned disabled (no modification)
249.960u 0.240s 4:14.11 98.4% 0+0k 0+0io 451pf+0w
191.870u 0.210s 3:15.29 98.3% 0+0k 0+0io 264pf+0w
241.350u 0.400s 4:10.98 96.3% 0+0k 0+0io 263pf+0w

With warmap.returned enabled
248.630u 0.300s 4:25.32 93.8% 0+0k 0+0io 264pf+0w
192.440u 0.230s 3:22.02 95.3% 0+0k 0+0io 297pf+0w
239.640u 0.240s 4:02.20 99.0% 0+0k 0+0io 265pf+0w

With warmap.returned removed
247.100u 0.240s 4:11.02 98.5% 0+0k 0+0io 344pf+0w
189.990u 0.260s 3:12.65 98.7% 0+0k 0+0io 264pf+0w
238.170u 0.260s 4:01.05 98.9% 0+0k 0+0io 264pf+0w  

If I interpret the results correctly (looking at u time), enabling the
check sometimes gives an improvement; 
removal of the field gives stable although little improvement, it also
reduces volume of the code and memory used, so I suggest that it should
be applied to CVS asap.

Best,
G.


 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Sun, Sep 16, 2001 at 12:38:21PM -0700, Gregory Berkolaiko wrote:
> > diff -ur -Xfreeciv/diff_ignore freeciv/server/gotohand.c
> freeciv_mod/server/gotohand.c
> > --- freeciv/server/gotohand.c       Sun Sep 16 20:20:04 2001
> > +++ freeciv_mod/server/gotohand.c   Sun Sep 16 21:09:23 2001
> > @@ -182,6 +182,7 @@
> >        freelog(LOG_DEBUG, "returned before. getting next");
> >        return get_from_mapqueue(x, y);
> >      } else {
> > +      warmap.returned[*x][*y] = 1;
> 
> Why this change?



____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Attachment: remove_returned.diff
Description: remove_returned.diff


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