From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucio De Re To: 9fans@cse.psu.edu Subject: Re: [9fans] Ugly hack Message-ID: <20030216141859.N9084@cackle.proxima.alt.za> References: <20030215174605.I9084@cackle.proxima.alt.za> <0043a6a833ad0d4ab1079c5a650c3b23@collyer.net> <20030216112012.L9084@cackle.proxima.alt.za> <20030216112527.M9084@cackle.proxima.alt.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20030216112527.M9084@cackle.proxima.alt.za>; from Lucio De Re on Sun, Feb 16, 2003 at 11:25:27AM +0200 Date: Sun, 16 Feb 2003 14:18:59 +0200 Topicbox-Message-UUID: 62837936-eacb-11e9-9e20-41e7f4b1d025 On Sun, Feb 16, 2003 at 11:25:27AM +0200, Lucio De Re wrote: > > Oops! Here's a clearer patch: > > term% diff glob.c `{yesterday glob.c} > 69c69 > < while(Readdir(f, namep, dironly||namep[1]!=0)){ > --- > > while(Readdir(f, namep, dironly)){ > And here's one that actually doesn't break globbing: term% diff glob.c `{yesterday glob.c} 69c69 < while(Readdir(f, namep, dironly||*newp=='/')){ --- > while(Readdir(f, namep, dironly)){ term% > PS: I don't know how important it is to check whether there actually > is a speed improvement when expanding big directories. Error discovered while trying to display /bin/*/* for timing purposes. I still don't know if there is a speed improvement. But if the following is anything to go by: term% time rc -c 'echo /bin/*/* > /tmp/out.2' 0.02u 0.31s 1.18r rc -c echo /bin/*/* > /tmp/out.1 term% time /sys/src/cmd/rc/8.out -c 'echo /bin/*/* > /tmp/out.2' 0.03u 0.08s 0.27r /sys/src/cmd/rc/8.out -c echo /bin/*/* > /tmp/out.2 term% it looks pretty much a worthwhile improvement. ++L