Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site ttds.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!mcvax!enea!ttds!johanw From: johanw@ttds.UUCP (Johan Wide'n) Newsgroups: net.bugs.4bsd Subject: speedup of tcsh Message-ID: <877@ttds.UUCP> Date: Wed, 3-Apr-85 21:00:35 EST Article-I.D.: ttds.877 Posted: Wed Apr 3 21:00:35 1985 Date-Received: Sat, 6-Apr-85 01:44:14 EST Reply-To: johanw@ttds.UUCP (Johan Wide'n) Organization: The Royal Inst. of Techn., Stockholm Lines: 52 Index: /usr/src/local/tcsh/sh.exec.c Description: A little over a year ago Paul Placeway posted an enhancement to csh. These enhancements built upon Ken Greers modifications of csh. The result is called tcsh. There was a problem with the enhancements as distributed: Login took a very long time. Some debugging shows that tcsh spends almost all it's time in rehash during login. I finally got around too fixing this. When a rehash is performed all directories in 'path' (except '.') are read. As distributed tcsh checks that a file in 'path' is executable before permitting it to enter the hash table. It is this check (system call access()) that is responsible for the long time spent in dohash(). As almost all files in 'path' are executable no great harm is done by eliminating this code. Fix: *** /tmp/,RCSt1013839 Thu Mar 28 15:04:39 1985 --- sh.exec.c Thu Mar 28 14:57:18 1985 *************** *** 285,297 if (*(dp->d_name) == '.') continue; - strcpy (fnamebuf, *pv); - strcat (fnamebuf, "/"); - strcat (fnamebuf, dp->d_name); - - if (access(fnamebuf, 1)) /* if not exe file */ - continue; - xhash[hash(dp->d_name)] |= (1 << i); tw_add_comm_name (dp->d_name); } --- 285,290 ----- if (*(dp->d_name) == '.') continue; xhash[hash(dp->d_name)] |= (1 << i); tw_add_comm_name (dp->d_name); } End of fix. johanw@ttds.UUCP Johan Widen KTH TTDS S-100 44 Stockholm SWEDEN