This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Speed up "gdb -tui" output
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 07 Jan 2015 20:30:38 +0200
- Subject: Re: [PATCH] Speed up "gdb -tui" output
- Authentication-results: sourceware.org; auth=none
- References: <83zj9v7urq dot fsf at gnu dot org> <CADPb22Q7oD3K-dYkngEPDBbV++mLCKifTEmvJczQ=0h2FX0yXA at mail dot gmail dot com> <83sifn7mpt dot fsf at gnu dot org> <CADPb22QeiSrzD81kMJeqpnDBrx1DybpbGmHc1r0koGDtqAu8tw at mail dot gmail dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Tue, 6 Jan 2015 12:54:02 -0800
> From: Doug Evans <dje@google.com>
> Cc: gdb-patches <gdb-patches@sourceware.org>
>
> >> Another possibility would be to do the string -> char -> string
> >> processing differently. String printing utilities could accumulate
> >> what they want to print and send the output in chunks instead
> >> of characters.
> >> Then tui_puts could get real strings instead of always getting
> >> { char, '\0' }, and maybe that would be enough.
> >
> > This will hit the same problem: how to know when to stop accumulating
> > and flush it out.
>
> What I'm saying is tui_puts would still call wrefresh unconditionally.
> This is no different than your patch, conceptually, except that
> it'd be up to higher layers to not send tui_puts a character at a time for the
> common case of outputting strings.
In the current implementation, tui_puts almost _always_ gets a single
character. This is because all the *_unfiltered output functions
eventually call null_write, which calls the to_fputs method one
character at a time (and has some apology to defend that).
> We send output a character at a time in part to support
> lines_per_page, chars_per_line, and wrap_column,
> relying on character-at-a-time buffering to save us.
> Alas for windows that doesn't apparently doesn't work (yay windows).
The problem is not Windows per se, it's the Windows console driver
implemented as part of ncurses.
> So one way to go, and again, this is just a possibility,
> is to not send tui_puts a character at a time.
This means a major redesign of how ui-file and friends work, much more
than the energy and time I have to spend on this issue.
> Is it possible to fix windows?
> If the bug really is there ...
It isn't.