public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: unbuffer all input streams when not using readline
Date: Mon, 07 Feb 2022 10:27:11 +0000	[thread overview]
Message-ID: <877da79dkw.fsf@redhat.com> (raw)
In-Reply-To: <20220202162317.GI425591@redhat.com>

Andrew Burgess <aburgess@redhat.com> writes:

> * Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> [2022-01-18 11:26:42 -0500]:
>
>>
>> The change looks ok to me (better than the status quo), given that
>> correctness is more important than performance.
>>
>> I'm just wondering if there's a noticeable performance difference
>> between having the input buffered vs unbuffered.  Calling fgetc with
>> unbuffered input means we do one syscall per character.  With frontends
>> sending tons of commands, it could possibly affect the responsiveness
>> and degrade user experience.  But it's just a guess, we should be able
>> to measure it.
>
> I'm planning to go ahead and push this patch - I'll give it a couple
> more days in case someone wants to shout stop!
>
> On input performance:
>
>   - I tested this and was a <1% slow down, which seem acceptable to
>     me,
>
>   - I notice that readline reads its input one character at a time
>     too, so now our non-readline input is handled the same way,
>
>   - This function is not used for reading commands from a file (I did
>     a simple test, and didn't hit this function), so shouldn't impact
>     that case at all.
>
> On output performance:
>
>   - The unbuffering will only impact the output file descriptor for
>     the new-ui case, usually, in all other cases, in and out are
>     separate file descriptors,
>
>   - The new-ui command only really makes sense for spinning up mi
>     interpreters,
>
>   - The mi interpreter buffers its output in string_files (see
>     mi/mi-out.c), and then writes the output in a single command, so
>     we shouldn't see any change in performance.
>
> As this patch fixes a real bug, I think, lets merge this now, and if
> there's any issues later, we can figure out what to do then.

I've now pushed this patch.

Thanks,
Andrew


  reply	other threads:[~2022-02-07 10:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 16:40 Andrew Burgess
2022-01-18 16:26 ` Simon Marchi
2022-01-18 17:09   ` Andrew Burgess
2022-01-18 17:57     ` Simon Marchi
2022-01-18 18:09     ` Andrew Burgess
2022-01-18 18:59       ` Tom Tromey
2022-02-02 16:23   ` Andrew Burgess
2022-02-07 10:27     ` Andrew Burgess [this message]
2022-01-18 18:52 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877da79dkw.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).