Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7279) Macro optimizations
Home

[Freeciv-Dev] (PR#7279) Macro optimizations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: a-l@xxxxxxx
Subject: [Freeciv-Dev] (PR#7279) Macro optimizations
From: "Marcelo Burda" <mburda@xxxxxxxxx>
Date: Wed, 4 Feb 2004 06:40:54 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [rwetmore@xxxxxxxxxxxx - Mer. Jan. 21 01:10:39 2004]:
> 
> 
> Arnstein Lindgard wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=7279 >
> > 
> > This patch makes the server 17.6% faster.
...
> is_normal_map_pos is a completely unnecessary function and like income
> taxes was only implemented as a temporary hack to detect unnormal
> coordinates during the normalization purges. 

This is good for me as it in assert and is some selected places only.

> Although born deprecated,
> its (ab)use has continued to grow for various religious reasons.
> 
> It really is time to get rid of it, though.
> 
> > 2.  Turned normalize_map_pos() into a macro as well. Another 5% gain.
> >     (It was neccessary to change "pf_map *map" into "pf_map *pf_map"
> >     throughout the code, since the global variable "map" is now used
> >     more often.)
> 
> Global variables are bad.
> 
> Though this is a repeat, it bears repeating since the message seems to
> be very difficult to absorb for some people.
> 
> > 3.  Macro base_city_map_to_map(). Another 2.4%.
> > 
> > It wasn't that hard, presuming I didn't completely miss something.
> 
> No, not hard at all.
Hard and you miss something ;-) (something related to reversed wraping
topologies! )

if i make it as macros, and other topological function too we no more
can use gprof to evaluate the impact of topological work, probably there
is best to pospose to switch to macros until new topo work as evoluted a
litle. there are easy to switch to inline or frmm inline function to
best evaluate the impact of a oftend used code!! then we can suitch to
macro. 
Today topologies is hard developing stade. 
Marcelo



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