Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
Re: [Freeciv-Dev] Slow response time (PR#104)
Home

Re: [Freeciv-Dev] Slow response time (PR#104)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] Slow response time (PR#104)
From: Artur Biesiadowski <abies@xxxxxxxxx>
Date: Thu, 12 Aug 1999 20:39:26 +0200

It is true.
For people that wants to save 20 minutes I've put profiling output at
http://thenut.eti.pg.gda.pl/~abies/freeciv/freeciv.prof.gz

It seems that major offender is really_generate_warmap. It is called
only 2398 times, but uses most of the time. But a lot of time could be
saved by inlinging few functions I think. Most notably
map_get_terrain/tile - they were called 1760972094/1405613169 times
respectively.


I suppose that we can safely inline each function that is over or close
to 100.000.000 calls. This is about 15 funs, which should give a lot of
speedup. But even with that I suppose that we would gain at most 50%. 

Data about generate_warmap is

  0.00    0.35       1/1461        ai_manage_explorer [87]
  0.00    2.10       6/1461        find_something_to_kill [47]
  0.00   10.50      30/1461        ai_manage_ferryboat [26]
  0.00  169.36     484/1461        ai_military_findjob [14]
  0.00  328.93     940/1461        assess_danger [9]


So there are two main areas for improvement. Reduce number of calls to
generate_warmap (maybe it is not really needed always), second is to
change generate_warmap to 
a) be really optimized performance wise
b) use some suboptimal but a lot faster algo

Artur

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