Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] [RFC] square_dxy_iterate
Home

[Freeciv-Dev] [RFC] square_dxy_iterate

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] [RFC] square_dxy_iterate
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Feb 2002 23:38:11 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

From the profile of an autogame (with disabled CHECK_MAP_POS):
Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 11.67     63.58    63.58   126346     0.50     0.71  really_generate_warmap
  4.64     88.87    25.29 573434095     0.00     0.00  normalize_map_pos
  2.89    104.59    15.72 352764568     0.00     0.00  unit_type_flag
  2.79    119.78    15.19 241976520     0.00     0.00  tech_exists
  2.40    132.83    13.05 255235503     0.00     0.00  map_get_terrain
  2.25    145.06    12.23 129703250     0.00     0.00  base_city_map_to_map
  2.16    156.83    11.77 168168833     0.00     0.00  map_get_city
  1.98    167.60    10.77 348949403     0.00     0.00  map_get_tile
...

[ snip a lot of other functions which have called normalize_map_pos]
                0.21    0.00 4741422/573434095     city_desirability [89]
                0.21    0.00 4794846/573434095     wakeup_neighbor_sentries 
[213]
                0.34    0.00 7739172/573434095     check_map [155]
                0.42    0.00 9610259/573434095     base_map_to_city_map [164]
                0.64    0.00 14442190/573434095     is_square_threatened [148]
                0.64    0.00 14486079/573434095     city_can_be_built_here [158]
                0.65    0.00 14765904/573434095     really_generate_warmap [13]
                0.72    0.00 16218896/573434095     
city_exists_within_city_radius [127]
                0.74    0.00 16797866/573434095     evaluate_city_building [23]
                0.78    0.00 17797248/573434095     evaluate_improvements [19]
                0.83    0.00 18903549/573434095     server_set_tile_city <cycle 
2> [91]
                1.13    0.00 25667851/573434095     ai_manage_explorer [50]
                1.31    0.00 29738934/573434095     
city_reinforcements_cost_and_value [84]
                1.34    0.00 30433554/573434095     goto_is_sane [80]
                1.42    0.00 32117399/573434095     is_my_zoc [83]
                1.47    0.00 33429149/573434095     road_bonus [79]
                2.03    0.00 46066274/573434095     is_real_tile [138]
                2.43    0.00 55095232/573434095     city_map_to_map [72]
                2.90    0.00 65652162/573434095     is_terrain_near_tile [75]
                3.56    0.00 80695222/573434095     invasion_funct [66]
[41]     4.6   25.29    0.00 573434095         normalize_map_pos [41]

-----------------------------------------------
                5.40    9.26 2379222/2379222     find_something_to_kill [7]
[66]     2.7    5.40    9.26 2379222         invasion_funct [66]
                5.55    0.00 79261963/168168833     map_get_city [74]
                3.56    0.00 80695222/573434095     normalize_map_pos [41]
                0.05    0.10  165328/165625      has_defense [406]
-----------------------------------------------

80695222/2379222=33.916 calls of normalize_map_pos for each call of
invasion_funct. It turns out that square_dxy_iterate is the
problem. And the second one (is_terrain_near_tile) uses adjc_iterate.

Are there any is_border patches or similar handy which solve this?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "> WHY?! Isn't it better to put $(shell cat cscope.files) on the list of
  I only have a yellow belt in makefile kungfu.  These fancy gnu make things
  are relatively new to some of us..."
    -- Mark Frazer to Vassilii Khachaturov in linux-kernel


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