[Freeciv-Dev] Re: MORT
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
new_amortize.c
Description: table-based amortize function
|
|