Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] Re: (PR#10985) AutoReply: Calculating city->ai.founder_wan
Home

[Freeciv-Dev] Re: (PR#10985) AutoReply: Calculating city->ai.founder_wan

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#10985) AutoReply: Calculating city->ai.founder_want kills performance; simple patch included
From: "Knut Omang" <komang@xxxxxxxxxxxx>
Date: Sun, 14 Nov 2004 03:05:16 -0800
Reply-to: rt@xxxxxxxxxxx

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

After some playing with the fix - it does not seem to give the same
effect in general - still the AI computations consume so much time
combined with the fact that the clients becomes irritatingly
unresponsive after the last user presses the turn button.

Has there been any discussions on parallelism in the game? 
A simple quasi-parallel approach as a quick fix might be to allow user
interaction to take place (empty the user event queue) in between each
AI - eg. allow actions like city maintenance operations to slip through
etc. so that users can utilize the waiting time..

In the long run a thread based model where the AI's do their work in
parallel with users would be nice but is of course a lot of work..

On Thu, 2004-11-11 at 23:58, The default queue wrote:
> Greetings,
> 
> This message has been automatically generated in response to the
> creation of a trouble ticket regarding:
>       "Calculating city->ai.founder_want kills performance; simple patch 
> included", 
> a summary of which appears below.
> 
> There is no need to reply to this message right now.  Your ticket has been
> assigned an ID of [PR#10985].
> 
> Please include the string:
> 
>          [PR#10985]
> 
> in the subject line of all future correspondence about this issue. To do so, 
> you may reply to this message.
> 
>                         Thank you,
>                         
> 
> -------------------------------------------------------------------------
> I include a small patch I made to speed up the ai calculations which are
> very slow in 2.0 compared to before..
> 
> In one scenario (a large map, 6 ai's, 2 humans and somewhat into the
> game) my Athlon 1600 spent up to two minutes on switching turn.
> Fairly early in the game more than 80% of the CPU cycles were spent
> calculating ai.founder_want, see included log, first round (-d 3)
> 
> I added a parameter similar to the ai.next_recalc for the founder_want
> calculation. This made overhead drop from 30 to 3-4 secs from the 1st
> round to the following rounds (this log from restarting after fix):
> 
> ------------------(start log)--------------------
> Starter spillet.
> > 
> Spiller 'Henry Grattan' har nå AI vanskelighetsgrad 'easy'.
> Spiller 'Osman' har nå AI vanskelighetsgrad 'easy'.
> Spiller 'Jan III Sobieski' har nå AI vanskelighetsgrad 'easy'.
> Spiller 'Llywelyn ap Gruffudd' har nå AI vanskelighetsgrad 'easy'.
> Spiller 'Peregrin' har nå AI vanskelighetsgrad 'easy'.
> Spiller 'Batthyány' har nå AI vanskelighetsgrad 'easy'.
> 3: End/start-turn server/ai activities: 0,99 seconds
> > 
> 3: Harald HÃ¥rfagre's autosettlers consumed 10 milliseconds.
> 3: George Washington's autosettlers consumed 10 milliseconds.
> 3: Henry Grattan's autosettlers consumed 1320 milliseconds.
> 3: Osman's autosettlers consumed 960 milliseconds.
> 3: Suggesting city name for Jan III Sobieski at (48,141)
> 3: Jan III Sobieski's autosettlers consumed 1570 milliseconds.
> 3: Llywelyn ap Gruffudd's autosettlers consumed 950 milliseconds.
> 3: Suggesting city name for Peregrin at (165,157)
> 3: Peregrin's autosettlers consumed 1030 milliseconds.
> 3: Batthyány's autosettlers consumed 1290 milliseconds.
> 3: autoattack consumed 10 milliseconds.
> 3: End/start-turn server/ai activities: 35,89 seconds
> 
> 3: Harald HÃ¥rfagre's autosettlers consumed 0 milliseconds.
> 3: George Washington's autosettlers consumed 10 milliseconds.
> 3: Suggesting city name for Henry Grattan at (139,52)
> 3: Henry Grattan's autosettlers consumed 380 milliseconds.
> 3: Suggesting city name for Osman at (68,47)
> 3: Suggesting city name for Osman at (89,39)
> 3: Suggesting city name for Osman at (91,33)
> 3: Suggesting city name for Osman at (99,50)
> 3: Osman's autosettlers consumed 360 milliseconds.
> 3: Suggesting city name for Jan III Sobieski at (56,131)
> 3: Jan III Sobieski's autosettlers consumed 60 milliseconds.
> 3: Suggesting city name for Llywelyn ap Gruffudd at (22,168)
> 3: Suggesting city name for Llywelyn ap Gruffudd at (26,21)
> 3: Llywelyn ap Gruffudd's autosettlers consumed 40 milliseconds.
> 3: Peregrin's autosettlers consumed 30 milliseconds.
> 3: Suggesting city name for Batthyány at (17,62)
> 3: Suggesting city name for Batthyány at (9,30)
> 3: Batthyány's autosettlers consumed 560 milliseconds.
> 3: autoattack consumed 0 milliseconds.
> 3: End/start-turn server/ai activities: 3,61 seconds
> ...
> 3: End/start-turn server/ai activities: 4,06 seconds
> ...
> 3: End/start-turn server/ai activities: 3,93 seconds
> ----------(end log)---------------
> 
> Included patch from CVS, 2.0 branch as of today,
> 
> Regards,
-- 
Knut Omang, Ph.D.               Mail:   Knut.Omang@xxxxxxx 
Senior Research Scientist       Web:    http://www.fast.no/ 
Fast Search & Transfer ASA      Phone:  +47 23 01 12 17
P.O. Box 1677 Vika              Fax:    +47 23 01 12 01
NO-0120 Oslo, NORWAY            Mob:    +47 48 01 12 17






[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#10985) AutoReply: Calculating city->ai.founder_want kills performance; simple patch included, Knut Omang <=