.cshrc efficiency note

UNIX 4.2 BSD root at icst-cmr.arpa
Sun May 4 11:55:17 AEST 1986


	From: Mike Muuss <mike at BRL.ARPA>
	
	If your .cshrc contains a like like:
	
	set prompt=\!\ "`hostname`>"\ 
	
	then this will cause the /bin/hostname program to be run FOR EVERY
	PROMPT that the CSH prints out!  This can be a non-trivial load if
	20-30 people are doing this.  Instead, I recommend the two line
	replacement:
	
	set hostname=`hostname`
	set prompt=\!\ "$hostname"\>\ 
	
	since it is unlikely that the host name will change during a login
	session.
		-Mike
	
Boy, you guys at BRL must have hacked BSD too much! Back out that last fix!
I don't know how you came to that conclusion. Here is the output of `sa -nj'
with the middle part left out:

   12972      33.50re       0.02cp        11avio      2549k
    1764       0.08re       0.00cp         1avio      3527k   sh
    1688       5.74re       0.00cp         0avio      1102k   cron*
    1411      13.26re       0.04cp        16avio     -7948k   sendmail*
    1294       0.00re       0.00cp         2avio         0k   test
     715       0.02re       0.00cp        13avio         0k   dmesg
     710       0.01re       0.00cp        10avio         0k   atrun
     577       0.01re       0.00cp         5avio      1483k   mv
     397       0.03re       0.01cp         6avio      5140k   ls
     264       2.46re       0.02cp        46avio      9832k   mail
     264       0.01re       0.00cp         3avio         0k   basename
     245     213.68re       0.06cp        44avio      9387k   csh
...
       9       0.05re       0.00cp        13avio         0k   sort
       9       0.02re       0.00cp        25avio         0k   df
       8     241.43re       0.23cp       345avio      2520k   find
       8       5.73re       0.04cp        22avio     10018k   ex
       8       0.05re       0.02cp         7avio      1982k   pstext
       8       0.05re       0.01cp        25avio      3858k   rcp
       8     713.71re       0.00cp         1avio         0k   lock
       8       0.00re       0.00cp         3avio         0k   hostname
...
       2       0.01re       0.00cp         2avio         0k   cmp
       2       0.01re       0.00cp         4avio         0k   [
       2       0.01re       0.00cp         3avio         0k   file
       2       0.01re       0.00cp         4avio         0k   head
       2       0.06re       0.00cp         2avio         0k   sleep

	(Root Boy) Jim Cottrell		<rbj at cmr>
	"One man gathers what another man spills"



More information about the Comp.unix.wizards mailing list