From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10926 invoked by alias); 7 Jan 2012 01:57:01 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30097 Received: (qmail 6573 invoked from network); 7 Jan 2012 01:56:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vhrp5Nmo/A14U/jm54QB3GqNMoZ09YOa+ELxGwls7Zs=; b=CrOwW72ySs/q5kWHbOwuACwR+fBp/azkpKg5Ffdz7a6zAx+NiF3eGLw7AKgBEMV5Z9 HcwrHSd5QbL/n6OZ1JvJa+uiZS8WVAyFsHBPyOvxeOvHxXNBuHbtIQWPB8R6tl25h8fp 9gHLObZ+zWq/9//RRBP9OWSzhjoUN0ZQKop7g= MIME-Version: 1.0 In-Reply-To: References: <20229.54117.22089.85103@gargle.gargle.HOWL> <20120105193518.GE80751@dan.emsphone.com> Date: Sat, 7 Jan 2012 02:56:45 +0100 Message-ID: Subject: Re: zsh hangs loading init files From: Mikael Magnusson To: gak@klanderman.net Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 7 January 2012 02:36, Greg Klanderman wrote: >>>>>> On January 6, 2012 Mikael Magnusson wrote: > >> I suspect this is the one, http://www.zsh.org/mla/users/2009/msg00786.html > >> +2009-09-21 Peter Stephenson >> + >> + * users/14411: Src/hashtable.c: only hash stat-able executable >> + regular files in the command table. >> + > > You probably haven't gotten my followup to my followup yet. > > Adding "setopt nohashdirs" gets me past the $(uname -s) quickly, but > then later, accessing $commands[foo] still causes it to go stat() > every file under every element of my path. Which is causing the 10-30 > second hang. There is no option to disable the stat()ing while filling the hash, and you do want to fill the hash, or you won't be able to complete any command names. % setopt no${^options[(I)hash*]} % hash -r % ls #to put one command in the hash % l ---- external command ls Incidentally, the manpage says HASH_DIRS Whenever a command name is hashed, hash the directory containing it, as well as all directories that occur earlier in the path. Has no effect if neither HASH_CMDS nor CORRECT is set. However, setting hashdirs still causes the hash to be filled when both hashcmds and correct are unset. % setopt no${^options[(I)hash*]} % hash -r % ls % hash | wc -l 1 % setopt hashdirs % ls % hash | wc -l 3480 -- Mikael Magnusson