Re: [Freeciv-Dev]  Some performance issues
[Top] [All Lists]
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
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
 
 
 
 | 
 |