Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index
Home

[Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jshort@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7195) inlining map_pos_to_index
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Thu, 8 Jan 2004 11:52:13 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Sun, Jan 04, 2004 at 03:34:37PM -0800, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7195 >
> 
> The attached patch inlines map_pos_to_index.  This speeds up the server 
> by 5-10% as well as making the code smaller and more readible.
> 
> This is a special case of a piece of code that NEEDS to be 
> inlined/macrod, but for which macros are much inferior to inlining.  In 
> a discussion some weeks ago, the maintainers decided that inlining was 
> allowed but could not agree on the exact criteria for what should be 
> inlined.  We agreed that function-like macros and inlining should only 
> be used when it gives a helpful increase in overall speed - which 
> probably means most of our current macros should be (non-inline) 
> functions instead.  I think we all agreed this piece of code was a good 
> candidate for inlining.

My numbers:

gcc plain:     10m39.150s
gcc inline:     9m39.660s -9.3%

I have also tested and found that even without the patch the gcc and
icc savegames differ after -3500. This may indicate use of
uninitialized memory or similar things.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Sit, disk, sit. Good boy. Now spin up. Very good. Here's a netscape
  cookie for you. Fetch me some data. Come on, you can do it. No, not that
  data. Bad disk. Bad." 
    -- Calle Dybedahl, alt.sysadmin.recovery




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