Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] [Patch] Tile sprite cache
Home

[Freeciv-Dev] [Patch] Tile sprite cache

[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] [Patch] Tile sprite cache
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Oct 2001 19:03:06 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

This is my version to this problem. See also the previous from Kevin
Brown (http://arch.freeciv.org/freeciv-dev-200108/msg00194.html
http://arch.freeciv.org/freeciv-dev-200108/msg00776.html).

This patch works only for non-iso tilesets. The method
pixmap_put_tile_iso is just too ugly. I'm also not sure if the odering
can be changed.

Test: loading a game and pressing the right mouse button multiple
times to redraw/recenter the map

Results:

  without patch:
Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  us/call  us/call  name
 20.80      0.26     0.26  4301206     0.06     0.06  normalize_map_pos
 11.20      0.40     0.14    46562     3.01     6.28  
base_fill_tile_sprite_array
  8.80      0.51     0.11       45  2444.44  2444.44  wordwrap_string
  6.40      0.59     0.08   246309     0.32     0.39  tile_is_known
  3.20      0.63     0.04   416608     0.10     0.30  get_drawn_char
  3.20      0.67     0.04   372496     0.11     0.11  nearest_real_pos
  3.20      0.71     0.04    46562     0.86     9.93  fill_tile_sprite_array
  2.40      0.74     0.03   428511     0.07     0.13  map_get_terrain
  2.40      0.77     0.03   419058     0.07     0.43  get_drawn
  2.40      0.80     0.03   362786     0.08     0.14  map_get_tile
  2.40      0.83     0.03   144316     0.21     0.78  overview_tile_color
  2.40      0.86     0.03    82665     0.36     0.36  pixmap_put_overlay_tile

  with patch:
Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  us/call  us/call  name
 18.63      0.38     0.38  7235092     0.05     0.05  normalize_map_pos
  8.82      0.56     0.18   452469     0.40     0.56  map_get_city
  8.33      0.73     0.17   208338     0.82     1.56  overview_tile_color
  7.84      0.89     0.16   116131     1.38     3.62  fill_tile_sprite_array
  6.37      1.02     0.13  1034487     0.13     0.35  get_drawn_char
  5.88      1.14     0.12   116890     1.03     9.41  pixmap_put_tile
  5.39      1.25     0.11  1775082     0.06     0.11  is_real_tile
  4.90      1.35     0.10       45  2222.22  2222.22  wordwrap_string
  4.41      1.44     0.09  1045179     0.09     0.48  get_drawn
  3.92      1.52     0.08   591948     0.14     0.19  tile_is_known
  3.92      1.60     0.08     4000    20.00    24.04  tile_sprite_cache_update
  2.45      1.65     0.05   122451     0.41     0.41  get_canvas_xy
  1.47      1.68     0.03   461193     0.07     0.12  map_get_tile

Note that the amount of tiles drawn (calls to fill_tile_sprite_array)
differ by an factor of 2.5.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Tank: So what do you need? Besides a miracle.
  Neo: Guns. Lots of guns.
    -- From The Matrix

Attachment: tile_sprite_cache1.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] [Patch] Tile sprite cache, Raimar Falke <=