Fastest way to output to terminal

Mike Khaw mkhaw at teknowledge-vaxc.ARPA
Sun Sep 4 09:30:48 AEST 1988


->We have a very terminal-I/O intensive application and are attempting to 
->optimize the output to the terminal. (We looked at curses but decided against
->it because we needed more flexibility.)  What is the fastest way to get 
->output to the terminal?  We have tried two methods:
- ....
->Neither of these seems to be as fast as curses.  Someone told me curses is
->faster because it doesn't send very many 'locate cursor' ( tgoto (CM..) )
->commands.  Is this true?  Any other ideas?
- 
- Curses is fast because it doesn't actually output everything you send.  It
- keeps track of what is already on the screen and skips anything that is
- already there.  It also performs calculations to optimize the output
- depending on the functions available on the particular terminal.  You
- can get an idea of what is happening if your terminal has a "monitor"
- mode where it displays control sequences instead of obeying them.

I can corroborate the last paragraph above:
I actually had to do something like this on VMS once (no curses!).  We
had a terminal-output bound program, so to speed things up, we buffered
up 1 screen-update worth of output before blasting the buffered-up data
to the terminal.  It included (I think) internally optimizing cursor
motion commands to minimize the number of bytes sent to the terminal.
It speeded up the application appreciably.

Mike Khaw
-- 
internet: mkhaw at teknowledge.arpa
uucp:	  {uunet|sun|ucbvax|decwrl|uw-beaver}!mkhaw%teknowledge.arpa
hardcopy: Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303



More information about the Comp.unix.wizards mailing list