Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] (PR#6792) Re: Re: Freeciv is too slow
Home

[Freeciv-Dev] (PR#6792) Re: Re: Freeciv is too slow

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6792) Re: Re: Freeciv is too slow
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Fri, 7 Nov 2003 04:25:30 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6792 >

On Thu, Nov 06, 2003 at 10:46:24PM +0100, Raimar Falke wrote:
> On Wed, Nov 05, 2003 at 04:29:22PM -0800, Paul Zastoupil wrote:
> > I used to love playing a lazy game of Freeciv where you just press turn
> > done over and over.  I could play a game against 30 AI in under an hour.
> > Now just playing about 60 turns takes an hour because its SO SLOW.
> > 
> > I don't know whats slow, or what is causing it, but its been getting
> > slowly worse over time.  I'm running on a PIII-800 with 9 AIs and its
> > not fun. 
> > 
> > Just needed to vent a bit.
> 
> I noticed the same after a longer game here. The client memory will
> increase over 50MB. According to top civclient uses up all the
> memory. And the non-updating of the client window confirms this.
> 
> This is GTK2.

Some more data. Without measurement you will notice that this depends
on shared vision or not.

With the attached savegames and the attached patch I got these numbers
(new server, new client, pressing turn done):

gtk1 and ally.gz:
2: 6,224806:  before new year
2: 6,224876:  freeze_hint
2: 8,621707:  start turn
2: 8,621954:  thaw_hint

gtk1 and alone.gz:
2: 6,046712:  before new year
2: 6,046778:  freeze_hint
2: 7,746361:  start turn
2: 7,746679:  thaw_hint

gtk2 and ally.gz:
2: 6,636031:  before new year
2: 6,636098:  freeze_hint
2: 19,179748:  start turn
2: 19,180092:  thaw_hint

gtk2 and alone.gz:
2: 5,247316:  before new year
2: 5,247404:  freeze_hint
2: 7,643908:  start turn
2: 7,644367:  thaw_hint

These are wall clock times in seconds. So you have to wait 12s in the
gtk2/ally case and 0.3s in the gtk1/alone case.

NOTE that this is with the attached .civclientrc. Especially with
smooth_move_units=0
auto_center_on_unit=0

So the client should only update the overview canvas and the small
area which is visible in the main mapview.

        Raimar

P.S.: I found this log format (time since start of program) in log4j
and found it quite nice and helpful.

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "USENET is *not* the non-clickable part of WWW!"

Attachment: ally.gz
Description: application/gunzip

Attachment: alone.gz
Description: application/gunzip

[client]
version="1.14.99-devel"
default_user_name="chris"
default_server_host="localhost"
default_server_port=5555
default_metaserver="http://meta.freeciv.org/metaserver/";
default_sound_set_name="stdsounds"
default_sound_plugin_name=""
default_tileset_name="trident"
solid_color_behind_units=0
sound_bell_at_new_turn=0
smooth_move_units=0
smooth_move_unit_steps=5
do_combat_animation=1
ai_popup_windows=0
ai_manual_turn_done=1
auto_center_on_unit=0
auto_center_on_combat=0
wakeup_focus=0
draw_diagonal_roads=1
center_when_popup_city=0
concise_city_production=0
auto_turn_done=0
meta_accelerators=0
map_scrollbars=0
dialogs_on_top=1
ask_city_name=0
popup_new_cities=0
draw_map_grid=0
draw_city_names=1
draw_city_growth=1
draw_city_productions=1
draw_terrain=1
draw_coastline=0
draw_roads_rails=1
draw_irrigation=1
draw_mines=1
draw_fortress_airbase=1
draw_specials=1
draw_pollution=1
draw_cities=1
draw_units=1
draw_focus_unit=0
draw_fog_of_war=1
draw_borders=1
message_where_00=3  # Stadt: Unmögliches im Bau
message_where_01=3  # Stadt: erobert/zerstört
message_where_02=3  # Stadt: Feier
message_where_03=3  # Stadt: Aufruhr
message_where_04=3  # Stadt: Hungersnot
message_where_05=3  # Stadt: Hungersnot zu befürchten
message_where_06=3  # Stadt: gewachsen
message_where_07=3  # Stadt: wächst wahrscheinlich bald
message_where_08=1  # Stadt: benötigt Aquädukt
message_where_09=3  # Stadt: benötigt Aquädukt (im Bau)
message_where_10=3  # Stadt: normal
message_where_11=3  # Stadt: atomar angegriffen
message_where_12=3  # Stadt: untersteht nicht mehr der ASV
message_where_13=3  # Stadt: Vermindertes Wachstum vorschlagen
message_where_14=3  # Stadt: Ã?bergabe
message_where_15=1  # Stadt: Gründung
message_where_16=3  # Stadt: Arbeitsaufträge
message_where_17=3  # Civ: Barbarenaufstand
message_where_18=3  # Civ: Bürgerkrieg
message_where_19=3  # Civ: Anarchie
message_where_20=3  # Civ: Erstkontakt
message_where_21=3  # Civ: Neue Staatsform kennen gelernt
message_where_22=3  # Civ: Kaum noch Gold
message_where_23=3  # Civ: Umweltverschmutzung
message_where_24=3  # Civ: Aufruhr niedergeschlagen
message_where_25=3  # Civ: Aufruhr!
message_where_26=3  # Civ: Weltraumnachrichten
message_where_27=3  # Eigener Diplomat: Bestechung
message_where_28=3  # Eigener Diplomat: Politische Krise
message_where_29=3  # Eigener Diplomat: Flucht
message_where_30=3  # Eigener Diplomat: Botschaft
message_where_31=3  # Eigener Diplomat: Fehlschlag
message_where_32=3  # Eigener Diplomat: Verschwörung
message_where_33=3  # Eigener Diplomat: Vergiften
message_where_34=3  # Eigener Diplomat: Sabotage
message_where_35=3  # Eigener Diplomat: Diebstahl
message_where_36=3  # Feindlicher Diplomat: Bestechung
message_where_37=3  # Feindlicher Diplomat: Botschaft
message_where_38=3  # Feindlicher Diplomat: Fehlschlag
message_where_39=3  # Feindlicher Diplomat: Verschwörung
message_where_40=3  # Feindlicher Diplomat: Vergiften
message_where_41=3  # Feindlicher Diplomat: Sabotage
message_where_42=3  # Feindlicher Diplomat: Diebstahl
message_where_43=3  # Spiel: Rundfunknachrichten
message_where_44=3  # Spiel: Spiel beendet
message_where_45=1  # Spiel: Spiel begonnen
message_where_46=7  # Spiel: Nachricht des Server Operators
message_where_47=1  # Spiel: Nation gewählt
message_where_48=3  # Spiel: Spieler vernichtet
message_where_49=3  # Spiel: Bericht
message_where_50=3  # Spiel: Tonsignal
message_where_51=1  # Spiel: Jahreswechsel
message_where_52=3  # Global: Umweltkatastrophe
message_where_53=3  # Global: Atombombe gezündet
message_where_54=3  # Dorf: Eingeborenenaufstand
message_where_55=3  # Dorf: Stadtrecht
message_where_56=3  # Dorf: Goldfund
message_where_57=3  # Dorf: von Eingeborenen vernichtet
message_where_58=3  # Dorf: Söldner angeheuert
message_where_59=3  # Dorf: Siedler gefunden
message_where_60=3  # Dorf: Entdeckung gemacht
message_where_61=3  # Dorf: Einheit von Barbaren verschont
message_where_62=1  # Erweiterung: gekauft
message_where_63=3  # Erweiterung: gebaut
message_where_64=3  # Erweiterung: zwangsversteigert
message_where_65=3  # Erweiterung: neu gewählt
message_where_66=1  # Erweiterung: verkauft
message_where_67=3  # Forschung: in der GroÃ?en Bibliothek entdeckt
message_where_68=3  # Forschung: Neue Erkenntnisse
message_where_69=7  # Vertrag: Allianz
message_where_70=7  # Vertrag: gebrochen
message_where_71=3  # Vertrag: Waffenstillstand
message_where_72=3  # Vertrag: Frieden
message_where_73=3  # Vertrag: Karteneinsicht
message_where_74=1  # Einheit: Angriff fehlgeschlagen
message_where_75=1  # Einheit: Angriff erfolgreich
message_where_76=1  # Einheit: gekauft
message_where_77=3  # Einheit: gebaut
message_where_78=3  # Einheit: Verteidiger zerstört
message_where_79=3  # Einheit: Verteidiger überlebt
message_where_80=3  # Einheit: Produktion modernisiert
message_where_81=3  # Einheit: Ortswechsel
message_where_82=3  # Weltwunder: fertig
message_where_83=3  # Weltwunder: veraltet
message_where_84=1  # Weltwunder: Bau begonnen
message_where_85=3  # Weltwunder: Bau gestoppt
message_where_86=3  # Weltwunder: nächste Runde fertig
message_where_87=3  # Diplomatic Message
city_report_size=1
city_report_hstate_verbose=0
city_report_hstate_concise=1
city_report_workers=1
city_report_happy=0
city_report_content=0
city_report_unhappy=0
city_report_angry=0
city_report_specialists=1
city_report_entertainers=0
city_report_scientists=0
city_report_taxmen=0
city_report_attack=0
city_report_defense=0
city_report_supported=0
city_report_present=0
city_report_resources=1
city_report_foodplus=0
city_report_prodplus=0
city_report_tradeplus=0
city_report_output=1
city_report_gold=0
city_report_luxury=0
city_report_science=0
city_report_num_trade=0
city_report_food=1
city_report_pollution=0
city_report_growturns=0
city_report_corruption=0
city_report_waste=0
city_report_cma=1
city_report_building=1

[cma]
number_of_presets=16  # Wenn manuell eine Vorgabe hinzugefügt wird, mu� auch 
'number_of_presets' geändert werden.
preset={ 
"name","minsurp0","factor0","minsurp1","factor1","minsurp2","factor2","minsurp3","factor3","minsurp4","factor4","minsurp5","factor5","reqhappy","factortarget","happyfactor"
"study-1",-1,20,0,1,-20,1,-20,1,-20,1,-20,20,0,0,1
"klug",0,1,0,1,-20,1,-20,1,-20,1,-20,25,0,0,1
"study",0,20,0,1,-20,1,-20,1,-20,1,-20,20,0,0,1
"klug essen",0,13,0,1,-20,1,-20,1,-20,1,-20,2,0,0,1
"produzieren-1",-1,1,0,15,-20,1,-20,1,-20,1,-20,5,0,0,1
"arbeiten-1",-1,1,0,14,-20,1,-20,4,-20,1,-20,1,0,0,1
"superschlau",0,1,0,5,-20,1,-20,1,-20,1,-20,15,0,0,1
"modern-1",-1,1,0,10,-20,1,-20,1,-20,1,-20,10,0,0,1
"schlau",0,1,0,8,-20,1,-20,1,-20,1,-20,12,0,0,1
"produzieren",0,1,0,15,-20,1,-20,1,-20,1,-20,5,0,0,1
"paardy",1,1,0,10,-20,1,-20,4,-20,1,-20,1,1,0,1
"arbeiten",0,1,0,14,-20,1,-20,4,-20,1,-20,1,0,0,1
"modern - satt",2,1,0,10,-20,1,-20,1,-20,1,-20,10,0,0,1
"modern",0,1,0,10,-20,1,-20,1,-20,1,-20,10,0,0,1
"bauen",0,4,0,14,-20,1,-20,1,-20,1,-20,4,0,0,1
"essen",0,13,0,1,-20,1,-20,1,-20,1,-20,1,0,0,1
}
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.336
diff -u -u -r1.336 packhand.c
--- client/packhand.c   2003/10/27 14:25:24     1.336
+++ client/packhand.c   2003/11/07 12:21:24
@@ -38,6 +38,7 @@
 #include "player.h"
 #include "spaceship.h"
 #include "support.h"
+#include "timing.h"
 #include "unit.h"
 #include "worklist.h"
 
@@ -77,6 +78,25 @@
 static int *reports_thaw_requests = NULL;
 static int reports_thaw_requests_size = 0;
 
+struct timer *t = NULL;
+
+static void start_time(void)
+{
+  t = new_timer_start(TIMER_USER, TIMER_ACTIVE);
+}
+
+static char *get_time(void)
+{
+  static char buffer[100];
+  double d;
+  
+  if (!t)
+    start_time();
+  d= read_timer_seconds(t);
+  sprintf(buffer, "%f: ", d);
+  return buffer;
+}
+
 /**************************************************************************
   Unpackage the unit information into a newly allocated unit structure.
 **************************************************************************/
@@ -534,6 +554,7 @@
 {
   int i;
 
+  //freelog(LOG_NORMAL,"city_info(%d)",pcity->id);
   if(is_new) {
     unit_list_init(&pcity->units_supported);
     unit_list_init(&pcity->info_units_supported);
@@ -774,6 +795,7 @@
 **************************************************************************/
 void handle_before_new_year(void)
 {
+    freelog(LOG_NORMAL,"%s before new year",get_time());
   clear_notify_window();
   /*
    * The local idea of the game turn is increased here since the
@@ -792,6 +814,7 @@
 **************************************************************************/
 void handle_start_turn(void)
 {
+    freelog(LOG_NORMAL,"%s start turn",get_time());
   agents_start_turn();
   non_ai_unit_focus = FALSE;
 
@@ -901,7 +924,8 @@
   bool check_focus = FALSE;     /* conservative focus change */
   bool moved = FALSE;
   bool ret = FALSE;
-  
+
+  //freelog(LOG_NORMAL,"unit_info(%d)",packet_unit->id);
   punit = player_find_unit_by_id(get_player(packet_unit->owner),
                                 packet_unit->id);
 
@@ -1835,6 +1859,7 @@
   enum known_type old_known = ptile->known;
   bool tile_changed = FALSE;
 
+  //freelog(LOG_NORMAL,"tile_info(%d,%d)",packet->x,packet->y);
   if (ptile->terrain != packet->type) { /*terrain*/
     tile_changed = TRUE;
     ptile->terrain = packet->type;
@@ -2744,6 +2769,7 @@
 void handle_freeze_hint(void)
 {
   freelog(LOG_DEBUG, "handle_freeze_hint");
+  freelog(LOG_NORMAL,"%s freeze_hint",get_time());
 
   reports_freeze();
 
@@ -2756,6 +2782,8 @@
 void handle_thaw_hint(void)
 {
   freelog(LOG_DEBUG, "handle_thaw_hint");
+  freelog(LOG_NORMAL,"%s thaw_hint",get_time());
+
 
   reports_thaw();
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#6792) Re: Re: Freeciv is too slow, Raimar Falke <=