From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11926 invoked by alias); 19 Aug 2011 09:08:48 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16270 Received: (qmail 2295 invoked from network); 19 Aug 2011 09:08:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Fri, 19 Aug 2011 11:08:44 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: "Once-a-day" long delay before startup Message-ID: <20110819090844.GF1685@prunille.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20110814145749.GA6341@andrew.cmu.edu> <4E4D8D50.5040800@gmail.com> <20110819020336.GA21062@andrew.cmu.edu> <110818210558.ZM20788@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <110818210558.ZM20788@torch.brasslantern.com> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6194-vl-r44775 (2011-07-13) On 2011-08-18 21:05:58 -0700, Bart Schaefer wrote: > Refer to my earlier reply -- do as soon as possible during startup: > > unsetopt hashcmds hashdirs hashlistall > > On my system "zsh -fc 'which ...'" takes about 40% as long with those > options unset as it does with them set. > > Zsh is making the assumption that you'd prefer one big delay of a few > seconds at startup, to many tiny delays all the while the shell is > running. However, zsh's default options were determined in a time > when path searching was slow and those "tiny" delays were a lot less > tiny. Of course the tradeoff for getting your prompt sooner is that > you're going to have a delay the first time you attempt command > completion, because completion needs a filled hash table. With HASH_DIRS, couldn't zsh fill the hash table only when the directory is accessed? For instance, one may have remote directories, for which the NFS server is sometimes down, near the end of the path. So, when executing usual commands, the shell would not be affected by problems with the NFS server. Now, if zsh could fill the hash tables in background, this would be even better. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)