From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: unbuffer all input streams when not using readline
Date: Wed, 2 Feb 2022 16:23:17 +0000 [thread overview]
Message-ID: <20220202162317.GI425591@redhat.com> (raw)
In-Reply-To: <ebeb5097-057d-6681-bb6f-e2fadb776cab@polymtl.ca>
* 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.
Thanks,
Andrew
next prev parent reply other threads:[~2022-02-02 16:23 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 [this message]
2022-02-07 10:27 ` Andrew Burgess
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=20220202162317.GI425591@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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).