[lkml]   [1996]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Speeding up screen output for dialog

>>>>> "BS" == Bernd Schmidt <> writes:
In article <> Bernd Schmidt <> writes:

BS> I've been wondering why some dialog-based applications
BS> (e.g. menuconfig) take so long even on a P90 to draw the screen. So I
BS> made some investigations with strace. I found that ncurses writes to
BS> the screen in rather large blocks of bytes, but these get broken up in
BS> write_chan() in n_tty.c into single byte writes to the console, which
BS> is inefficient (I assume that setting the cursor after each write is
BS> the most time-consuming part). So I came up with a hack: Instead of
BS> calling opost() for each byte, I wrote a new function opost_block()
BS> that examines the buffer and returns the number of bytes that can be
BS> directly written. These are then passed to con_write() instead of
BS> put_char().
BS> I've attached a patch. Comments are welcome. I didn't try very hard to
BS> make opost_block() return the maximum number of characters that can be
BS> written, there may be some room for improvement. Even so, there is a
BS> substantial speed increase for menuconfig (I made the Makefile link
BS> lxdialog statically for good measure). It's almost enjoyable now :)
BS> [...patch removed...]

I've tried your patch with Linux/SPARC 2.0.18 running on a
SparcStation 2 with very slow bwtwo frame buffer. Previously while
editing under emacs I saw a delays of about 0.5 second when using ctrl-v
(next-page). Now it displays a new page immediately without any
noticeable delay!

That's great! Thank you for that patch!

- - Andreas

Version: 2.6.2i
Comment: Processed by Mailcrypt 3.3, an Emacs/PGP interface

Andreas Koppenhoefer, Student der Universitaet Stuttgart, BR Deutschland
Franz-Schubert-Str. 2, 97616 Bad Neustadt; Phone +49 9771 7943, Fax/Data 7947
<>; PGP-Key available at
URL <>

 \ /
  Last update: 2005-03-22 13:37    [W:0.106 / U:2.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site