Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: Profile.
Home

[Freeciv-Dev] Re: Profile.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Profile.
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: Sun, 14 Oct 2001 01:48:10 +0100

On Sat, 13 Oct 2001, gs234@xxxxxxxxx wrote:

> We can do much better than that.

I made an updated patch, and profiled an autogame with and without my
new patch applied.  The profiles confirm my earlier conclusions:

2001-10-14:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 14.37     99.37    99.37 2743091944     0.00     0.00  normalize_map_pos
  8.20    156.07    56.70   153201     0.37     0.59  really_generate_warmap
  3.95    183.41    27.34 299350093     0.00     0.00  map_get_city
  2.97    203.95    20.54 394669783     0.00     0.00  tech_exists
  2.64    222.22    18.27 386524203     0.00     0.00  unit_type_flag
  2.45    239.15    16.93 324919455     0.00     0.00  map_get_terrain
  2.17    254.19    15.04 439097511     0.00     0.00  map_get_tile
  1.98    267.86    13.67 455096417     0.00     0.00  is_real_tile
  1.71    279.66    11.80 163966199     0.00     0.00  base_city_map_to_map
  1.66    291.16    11.50 184901577     0.00     0.00  improvement_exists
  1.51    301.61    10.45 369375990     0.00     0.00  get_invention
  1.41    311.38     9.77  5469905     0.00     0.01  invasion_funct
  1.30    320.34     8.96 272087818     0.00     0.00  is_valid_city_coords
  1.29    329.24     8.90  4568320     0.00     0.00  win_chance
  1.26    337.98     8.74 96922674     0.00     0.00  get_from_mapqueue
  1.18    346.12     8.14    40950     0.20     0.43  look_for_charge
  1.17    354.21     8.09 135920583     0.00     0.00  city_got_building
  1.16    362.20     7.99 142792987     0.00     0.00  map_get_continent
  1.13    370.00     7.80  2665917     0.00     0.01  
player_knows_techs_with_flag
  1.12    377.72     7.72 170920238     0.00     0.00  find_genlist_position
...
  0.00    691.74     0.00        1     0.00     0.00  user_home_dir

2001-10-14-irt:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 13.25     88.16    88.16 2287995527     0.00     0.00  normalize_map_pos
  8.60    145.41    57.25   153201     0.37     0.60  really_generate_warmap
  3.55    169.06    23.65 299350093     0.00     0.00  map_get_city
  2.97    188.81    19.75 394669783     0.00     0.00  tech_exists
  2.78    207.33    18.52 386524203     0.00     0.00  unit_type_flag
  2.59    224.55    17.22 324919455     0.00     0.00  map_get_terrain
  2.21    239.27    14.72 439097511     0.00     0.00  map_get_tile
  1.80    251.28    12.01 163966199     0.00     0.00  base_city_map_to_map
  1.72    262.70    11.42 184901577     0.00     0.00  improvement_exists
  1.55    273.03    10.33 369375990     0.00     0.00  get_invention
  1.45    282.68     9.65  5469905     0.00     0.01  invasion_funct
  1.36    291.71     9.03 272087818     0.00     0.00  is_valid_city_coords
  1.35    300.70     8.99 96922674     0.00     0.00  get_from_mapqueue
  1.26    309.06     8.36  4568320     0.00     0.00  win_chance
  1.24    317.29     8.23 142792987     0.00     0.00  map_get_continent
  1.20    325.28     7.99 170920238     0.00     0.00  find_genlist_position
  1.19    333.23     7.95 277372653     0.00     0.00  unit_type
  1.19    341.15     7.92 135920583     0.00     0.00  city_got_building
  1.18    349.00     7.85    40950     0.19     0.42  look_for_charge
  1.14    356.57     7.57  2665917     0.00     0.01  
player_knows_techs_with_flag
...
  0.00    665.38     0.00        1     0.00     0.00  user_home_dir

The absolute gain is 691.74 - 665.38 = 26.36 seconds.  The gain is
11.21 seconds from removing redundant calls to normalize_map_pos(),
13.67 by removing the body of is_real_tile(), and 1.48 seconds from
the removal of function call overhead.

The relative gain is 4%.

As usual, anyone who is interested can find these profiles on their
own as:

  http://www.srcf.ucam.org/~gs234/gmon.out.2001-10-14.bz2
  http://www.srcf.ucam.org/~gs234/gmon.out.2001-10-14-irt.bz2

Attachment: irt.diff
Description: Text document

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Let's all show human CONCERN for REVEREND MOON's legal difficulties!!

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