Re: [PATCH 3/3 v2] Implement completion limiting

Doug Evans
2015-01-23T16:57:07Z

On Fri, Jan 23, 2015 at 8:34 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Fri, 23 Jan 2015 08:14:15 -0800
>> From: Doug Evans <xdje42@gmail.com>
>> Cc: Gary Benson <gbenson@redhat.com>,
>> "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
>>
>> The patch stops searching when the limit is reached.
>> It doesn't keep looking for at least one more to see if there are any more.
>> Is this absolutely critical? Why?
>
> Because if the user sets the maximum at N, she wants to see N
> elements, and if there are exactly N, she shouldn't get any warnings,
> IMO.

How often will there be exactly N?
And in that particular and massively rare case,
once gdb has found N, how much extra work will
be performed searching the entire executable
and all its shared libraries just to verify there are
in fact no more completions?
[because that's what has to happen if
we're to avoid printing *any* message]

The user waits 5 minutes for the entire list and
gets her 200 completions, and wonders
why it took so long. Then she digs a bit
deeper and finds out they were found
in the first 5 seconds. Ugh.

I don't see the benefit of going to the trouble
of avoiding printing any message when there are
exactly N completions.
If there are exactly N completions and I
see the message, no big deal.