Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2002:
[Freeciv-Dev] Re: Speed problem with CMA (PR#1508)
Home

[Freeciv-Dev] Re: Speed problem with CMA (PR#1508)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Christian Knoke <chrisk@xxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Speed problem with CMA (PR#1508)
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Sun, 26 May 2002 14:31:40 +0200

On Sun, May 26, 2002 at 05:07:24AM -0700, Christian Knoke wrote:
> CVS 26 MAY 2002
> 
> Changing the CMA preset globally for all cities (from within the 
> city report window) needs a lot of time. I think part of the 
> problem are the multiple updates of text lines here.
> 
> I fear the problem will get even bigger when you do this over 
> the internet (not tested).
> 
> Since most of the developers probably use powerful machines
> this may not have been noticed yet.
> 
> Example:
> 
> 200 MHz AMD K6-2 and PCI graphics
> 34 cities of size 8
> 
> Time needed: 16 seconds

For more detailed analysis you may want to apply this patch:

Index: client/agents/agents.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/agents/agents.c,v
retrieving revision 1.12
diff -u -r1.12 agents.c
--- client/agents/agents.c      2002/05/25 17:53:39     1.12
+++ client/agents/agents.c      2002/05/26 12:23:24
@@ -31,7 +31,7 @@
 #define DEBUG_REQUEST_IDS              FALSE
 #define DEBUG_TODO_LISTS               FALSE
 #define META_CALLBACKS_LOGLEVEL                LOG_DEBUG
-#define PRINT_STATS_LOGLEVEL           LOG_DEBUG
+#define PRINT_STATS_LOGLEVEL           LOG_NORMAL
 #define DEBUG_FREEZE                   FALSE
 #define MAX_AGENTS                     10
 
Index: client/agents/cma_core.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/agents/cma_core.c,v
retrieving revision 1.21
diff -u -r1.21 cma_core.c
--- client/agents/cma_core.c    2002/05/25 17:44:07     1.21
+++ client/agents/cma_core.c    2002/05/26 12:23:25
@@ -165,8 +165,8 @@
 #define EXPAND_CACHE3_LOG_LEVEL                                LOG_DEBUG
 
 #define SHOW_EXPAND_CACHE3_RESULT                       FALSE
-#define SHOW_CACHE_STATS                                FALSE
-#define SHOW_TIME_STATS                                 FALSE
+#define SHOW_CACHE_STATS                                TRUE
+#define SHOW_TIME_STATS                                 TRUE
 #define SHOW_APPLY_RESULT_ON_SERVER_ERRORS              FALSE
 #define DISABLE_CACHE3                                  FALSE
 #define ALWAYS_APPLY_AT_SERVER                          FALSE

Using your khan6.sav.gz I get (on my P2-400) (the second stats are
printed each turn):

2: A:CMA: waited 31.922491s in total for network; requests=464; waited 52 times
2: CMA: overall=1.284144s queries=120 10.701200ms / query
2: CMA: apply_result: ignored=39.5% (34) applied=60.5% (52) total=86
2: CMA: CACHE1: hits=27.3% misses=72.7% total=40811
2: CMA: CACHE2: hits=61.8% misses=38.2% total=29648
2: CMA: CACHE3: hits=17.5% misses=82.5% total=120

So the raw calculation needs only 1.3s. However the client has to wait
32s till all answers are processed. Reason: the city list and its
stupid update behavior. You can test it if you open only one city
dialog and play with the sliders till you have the same number of
requests and waited time. If I do this here I have only around 3s
instead of 32s.

GTK people?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "On the eigth day, God started debugging"


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