Complete.Org: Mailing Lists: Archives: freeciv-dev: April 1999:
Re: [Freeciv-Dev] Some performance issues
Home

Re: [Freeciv-Dev] Some performance issues

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Rizos Sakellariou <rizos@xxxxxxxxxxx>
Cc: Fabrice Noilhan <Fabrice.Noilhan@xxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Some performance issues
From: Stephen Hodge <stephenh@xxxxxxxxxx>
Date: Tue, 20 Apr 1999 20:57:20 +1000

Rizos Sakellariou wrote:
...
> Ok - let's get some things straight:
> - Portability is defined as whether your code can be easily compiled
>   and run on different architectures. Changing  y * map.xsize  with
>   something like  yoffset[y] for instance is not a machine dependent
>   operation and has nothing to do with portability.

Just a comment here - I think this sort of thing could hurt readability if
it is not done carefully. That would hurt portability to some degree.

> - Efficiency is associated with the performance of the code which
>   results from the code that the compiler generates. In the particular
>   case, there is scope of replacing a generally expensive multiplication
>   with a not so expensive load.

I think the major point was that mulitplication is NOT generally expensive.
A lookup is only really fast if the array is in the cache and the array
address is in a register. This sort of optimization might only make a
significant difference on a very small set of targets (UltraSPARCs using
Sun's compiler). In that case I would say it's not worth doing, just use a
better compiler.

> Finally: Performance tuning, especially for a variety of platforms,
> is a tedious process; if we also take into account the complexity
> of modern processors all this implies that one has to be investigative
> rather than authoritative.

I agree completely.

Regards,
Steve Hodge

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