Re: Does Anyone Compile Aspell with -DNDEBUG?

Kevin Atkinson <[email protected]> Sun, 1 Jun 2008 18:18:06 -0600 (MDT)
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <[email protected]>
On Sun, 1 Jun 2008, Jose Da Silva wrote:

> On June 1, 2008 03:46:16 pm Kevin Atkinson wrote:
>> On Sun, 1 Jun 2008, Jose Da Silva wrote:
>>> This should shed some light on the subject using a self-contained
>>> program. platform=linux, compiler = gcc, program=prezip.c
>>>
>>> $ time ./prezip_asserted -c <wordlist.txt >wordlist.cwl
>>> 0.06user 0.00system 0:00.08elapsed 84%CPU (0avgtext+0avgdata
>>> 0maxresident)k 0inputs+0outputs (0major+132minor)pagefaults 0swaps
>>> $ time ./prezip_debugged -c <wordlist.txt >wordlist.cwl
>>> 0.07user 0.00system 0:00.09elapsed 82%CPU (0avgtext+0avgdata
>>> 0maxresident)k 0inputs+0outputs (0major+132minor)pagefaults 0swaps
>>
>> This test needs to run several times in order for the results to be
>> meaningful.
>
> The test above spends an unknown amount of time in the program (in prezip),
> and outside the program (file handling, passing values through stdin and
> stdout). The stuff like stdin/stdout outside of prezip is basically
> outside of your control and therefore not something you can tweak for
> performance or debugging etc. I don't think you can get any significant
> info running the test several times.

Let me put it another way, since the times are so close, this statement is 
meaningless:

> user time increased from 0.06 to 0.07. This does not appear significant,
> except you "do" need to to take account that a big portion of the 
> 0.06user time is spent reading/writing stdin/stdout which means actual 
> time within the prezip program may be a small value such as 0.01. If so, 
> then a difference of 0.01 to 0.02 would be considered a big increase.

without running the tests multiple times.  Since on the second run the 
numbers may become 0.07 0.06.  There are a lot of things that can effect 
cpu time.

If you thing that the 0.01 difference is insignificant (thus running the 
tests again make no sense) than can I summarize your email as following:

   Coming prezip with -DNDEBUG or -g when combined with -O2 does not
   noticeably effect performance.