[Freeciv-Dev] Re: (PR#4075) rewrite base_map_to_city_map
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
> On Fri, Apr 25, 2003 at 03:37:31AM -0700, Per I. Mathisen wrote:
>
>>On Thu, 24 Apr 2003, Jason Short wrote:
>>
>>>When compiling with -O2 I found a small (0.9%) speed improvement in the
>>>overall server speed.When compiling with debugging this is negated
>>>(presumably by the extra CHECK_MAP_POS call done from map_distance_vector).
>>
>>While on this topic, can we please remove CHECK_MAP_POS from within very
>>frequently called nested constructs? This is a terrible speed killer, and
>>I've never seen it catch a bug. We'll find more bugs if the speed of
>>--enable-debug=yes is increased, so that more people will use it. At the
>>moment, it seems I'm the only one who does. And I don't want to be
>>everyone else's guinea pig.
>
>
> About --enable-debug=yes: you also take a rather large speed hit by
> freelog(LOG_DEBUG,...). With --enable-debug != yes the compiler will
> remove these calls. With --enable-debug=yes you have at least one
> function call logdebug_check. And these freelog(LOG_DEBUG,...) are in
> a sometimes in the nested loops. If you fix this somehow I may also
> switch to --enable-debug=yes.
Last I checked the difference between DEBUG and not was only 5-10%. How
is this worth not using debugging? I always just assumed people didn't
use it by default because it wasn't the default...
The CHECK_MAP_POS checks do catch bugs - mostly in new patches, before
they get applied. The borders patch is one such example; I also catch a
lot of gen-topologies bugs with them. Rather than removing them, I
think it would be better to macro-ise or inline them. (That said, there
are some that are pretty worthless or even downright wrong.)
jason
|
|