Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: MORT
Home

[Freeciv-Dev] Re: MORT

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: MORT
From: andrew_mcguinness@xxxxxxxxxxx
Date: Fri, 9 Jun 2000 21:11:17 +0000 (GMT)
Reply-to: andrew_mcguinness@xxxxxxxxxxx

On  9 Jun, Thue Janus Kristensen wrote:
>> It's only about 10% quicker, but if someone somewhere
>> is running freeciv on (say) a 486sx, it's likely to be
>> a much bigger difference.
>> 
>> I could send a patch with some explanatory comments.
> 
> Please. (yes, I know robert also helped)
> 
>> If you want to change MORT, then apart from the
>> ((23/24)**12)=(3/5) hack, you would have to deal with
>> the various hardcoded values in city_desirability.  I
>> don't 100% understand where they came from yet (the
>> comment says 
>> /* all of these kluges are hardcoded amortize calls
>> /* to save much CPU use -- Syela
>> )
> 
> How about making that lookup table you mentioned if it is so CPU
> critical. It could be generated on startup to allow changing MORT.
> 
> 
> -Thue
> 

I'm going away for two weeks, so I won't have time to put this
together.  Attached is a new amortize function.  It works, it's four to
five times faster, but I haven't had a chance to put it into freeciv
and test it.  If you want to play with the value of MORT in the next
two weeks, try using it.  The table initialise routine will have to be
called from somewhere in civserver.c:main()

Andrew



Attachment: new_amortize.c
Description: table-based amortize function


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