From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11991 invoked by alias); 19 Aug 2011 02:32:02 -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: 16265 Received: (qmail 5226 invoked from network); 19 Aug 2011 02:32:00 -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=-3.3 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_MED,T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: neutral (ns1.primenet.com.au: 128.2.11.96 is neither permitted nor denied by SPF record at _spf.google.com) Date: Thu, 18 Aug 2011 22:03:37 -0400 From: gi1242+zsh@gmail.com To: zsh-users@zsh.org Subject: Re: "Once-a-day" long delay before startup Message-ID: <20110819020336.GA21062@andrew.cmu.edu> Mail-Followup-To: gi1242+zsh@gmail.com, zsh-users@zsh.org References: <20110814145749.GA6341@andrew.cmu.edu> <4E4D8D50.5040800@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <4E4D8D50.5040800@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-PMX-Version: 5.5.9.388399, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.4.9.4220 X-SMTP-Spam-Clean: 34% ( RDNS_SUSP_FORGED_FROM 3.5, FORGED_FROM_GMAIL 0.1, SUPERLONG_LINE 0.05, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, NO_REAL_NAME 0, RDNS_BROADBAND 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, TO_NO_NAME 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CD 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_MSGID 0, __MIME_VERSION 0, __RDNS_BROADBAND_5 0, __RDNS_POOLED_11 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __USER_AGENT 0) X-SMTP-Spam-Score: 34% X-Scanned-By: MIMEDefang 2.60 on 128.2.11.96 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 19, 2011 at 12:08:16AM +0200, Piotr Karbowski wrote: > Hi, I have pretty much the same issue, the first login after boot, to =20 > each user take about 8-9s. > > In order to check whats going on I changed my login shell to bash and did: > > zsh -x 2>&1 | tee zsh-startup.log > > In order to save logs and I careful watch what pop up onto screen. I > have reproduced it few times, what you need to reproduce is reboot > system or drop_cache (echo 3 > /proc/sys/vm/drop_caches) and then > again run zsh as user. That's a neat trick. It reproduces the behaviour for me every time. It appears that building the command hash is the time consuming step. Here's what I did: 1. I created /tmp/.zshrc containing only print -P "${ZSH_NAME}-${ZSH_VERSION} ($ZSH_PATCHLEVEL)" which dircolors 2. I executed the commands =20 sudo echo 3 > /proc/sys/vm/drop_caches ZDOTDIR=3D/tmp zsh -xd 2>&1 | tee /tmp/zsh.log I saw the output +/etc/zsh/zshenv:15> [[ -z .:/home/gautam/bin:/usr/lib/ccache:/usr/local/b= in:/usr/bin:/bin:/usr/games || .:/home/gautam/bin:/usr/lib/ccache:/usr/loca= l/bin:/usr/bin:/bin:/usr/games =3D=3D /bin:/usr/bin ]] +/tmp/.zshrc:1> print -P 'zsh-4.3.12 (Debian)' zsh-4.3.12 (Debian) +/tmp/.zshrc:3> which dircolors /usr/bin/dircolors Once "which dircolors" appears on screen, I see a long long long pause (with the hard disk constantly spinning). After a long long long time, I finally see the output (/usr/bin/dircolors) appear. For comparison, I also executed the following sudo echo 3 > /proc/sys/vm/drop_caches sh which dircolors "sh" started instantly, and which dircolors executed instantly. I also checked that under the above conditions, the PATH in both sh and zsh were identical. I've no idea why "which dircolors" takes such a long time on zsh (when the cache is cleared), and runs instantly on sh. I'd appreciate any help. Thanks, GI --=20 Freedom of speech is wonderful - right up there with the freedom not to listen. --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk5NxG8ACgkQ6plSLtsExHGlewCfdB+xhGzWIkyfm22n4XeAnqIa yU8An3w1YDjiRtirad2ViU/Nyy4P2Ks2 =JGF3 -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT--