[TUHS] termcap vs terminfo (was: I swear! I rtfm'ed)

Johnny Billquist bqt at update.uu.se
Fri Jan 2 02:21:07 AEST 2015


On 2015-01-01 17:11, Mary Ann Horton<mah at mhorton.net> wrote:
>
> The move was from termcap to terminfo.  Termlib was the library for termcap.

Doh! Thanks for the correction. Finger fart.

> There were two problems with termcap.  One was that the two-character
> name space was running out of room, and the codes were becoming less and
> less mnemonic.

Ah. Yes, that could definitely be a problem.

> But the big motivator was performance.  Reading in a termcap entry from
> /etc/termcap was terribly slow.  First you had to scan all the way
> through the (ever-growing) termcap file to find the correct entry.  Once
> you had it, every tgetstr (etc) had to scan from the beginning of the
> entry, so starting up a program like vi involved quadratic performance
> (time grew as the square of the length of the termcap entry.)  The VAX
> 11/780 was a 1 MIPS processor (about the same as a 1 MHz Pentium) and
> was shared among dozens of timesharing users, and some of the other
> machines of the day (750 and 730 Vaxen, PDP-11, etc.) were even slower.
> It took forever to start up vi or more or any of the termcap-based
> programs people were using a lot.

Hum. That seems like it would be more of an implementation issue. Why 
wouldn't you just cache all the entries for the terminal once and for 
all? terminfo never came to 16-bit systems anyway, so we're talking 
about systems with plenty of memory. Caching the terminal information 
would not be a big memory cost.

Thanks for the insight.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol



More information about the TUHS mailing list