[Freeciv-Dev] Re: [RFC][Patch] Inline
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raahul Kumar wrote:
I was requesting those numbers. It seems -03 is a fairly bad optimisation.
Jason ran some tests on the stock freeciv, and he seemed to get large increases
in performance just by using NDEBUG. Jason, some comments on your previous
With your patch and NDEBUG the speed increase is minor. Why?
Short answer: he gets these gains already in the patch.
When NDEBUG is defined, CHECK_MAP_POS is defined out and so is never
called. CHECK_MAP_POS just calls is_normal_map_pos, which calls
normalize_map_pos. Both of these are functions, so there is a
substantial overhead to calling them . This is the largest source of
the difference between NDEBUG and !NDEBUG, though there are of course
other assertions in there as well.
Raimar's patch seems to disable CHECK_MAP_POS entirely (which is not
unreasonable, BTW...one plan was to change CHECK_MAP_POS to only be used
if DEBUG was defined before the release), so he'll get these benefits
without NDEBUG. Even without this, though, is_normal_map_pos and
normalize_map_pos are functions that should be inlined (currently only
normalize_map_pos is AFAICT), so the overhead would be less in any case.
 Before anyone clamours for their removal: they have helped in
tracking down a number of bugs and will probably help to track down many
[Freeciv-Dev] Re: [RFC][Patch] Inline, Jason Short, 2002/03/21
[Freeciv-Dev] a civserver patch testing framework (was: [RFC][Patch] Inline), Reinier Post, 2002/03/21