zsh-users
 help / color / mirror / code / Atom feed
* Opening a new tab is awkwardly slow
@ 2013-11-19 10:51 Timo Sand
  2013-11-19 15:33 ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Timo Sand @ 2013-11-19 10:51 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

Hi,

I'm using oh-my-zsh for a couple of years now and recently have noticed
that opening new shells is painfully slow. I ran `zprof` today and this is
the result. http://hastebin.com/rililedinu.log

I'm a bit stumped as to what `git` and `nvm` are doing there...

Here are my zsh configs:

https://github.com/deiga/dotfiles/blob/master/zprofile
https://github.com/deiga/dotfiles/blob/master/zshrc
https://github.com/deiga/dotfiles/blob/master/zsh/aliases.zsh
https://github.com/deiga/dotfiles/blob/master/zsh/system.zsh
https://github.com/deiga/dotfiles/blob/master/zsh/functions.zsh

-- 
Timo Sand
timo.j.sand+sig@gmail.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Opening a new tab is awkwardly slow
  2013-11-19 10:51 Opening a new tab is awkwardly slow Timo Sand
@ 2013-11-19 15:33 ` Bart Schaefer
  2013-11-19 16:27   ` Timo Sand
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2013-11-19 15:33 UTC (permalink / raw)
  To: zsh-users

On Nov 19, 12:51pm, Timo Sand wrote:
}
} I'm a bit stumped as to what `git` and `nvm` are doing there...

Trace output from "setopt xtrace" would probably be useful here.
Poring over someone else's config files by eye, not so much.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Opening a new tab is awkwardly slow
  2013-11-19 15:33 ` Bart Schaefer
@ 2013-11-19 16:27   ` Timo Sand
  2013-11-19 16:40     ` Peter Stephenson
  2013-11-19 16:57     ` Bart Schaefer
  0 siblings, 2 replies; 8+ messages in thread
From: Timo Sand @ 2013-11-19 16:27 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

Here's the xtrace output https://gist.github.com/deiga/7547991

Not sure how to debug this, any help would be appreciated :)


On 19 November 2013 17:33, Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Nov 19, 12:51pm, Timo Sand wrote:
> }
> } I'm a bit stumped as to what `git` and `nvm` are doing there...
>
> Trace output from "setopt xtrace" would probably be useful here.
> Poring over someone else's config files by eye, not so much.
>



-- 
Timo Sand
timo.j.sand+sig@gmail.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Opening a new tab is awkwardly slow
  2013-11-19 16:27   ` Timo Sand
@ 2013-11-19 16:40     ` Peter Stephenson
  2013-11-19 16:57     ` Bart Schaefer
  1 sibling, 0 replies; 8+ messages in thread
From: Peter Stephenson @ 2013-11-19 16:40 UTC (permalink / raw)
  To: Timo Sand, zsh-users

On Tue, 19 Nov 2013 18:27:40 +0200
Timo Sand <timo.j.sand@gmail.com> wrote:
> Here's the xtrace output https://gist.github.com/deiga/7547991
> 
> Not sure how to debug this, any help would be appreciated :)

In addition to setting xtrace, you can get the times to a fraction of a
second in the prompt.  Put the following somewhere early (first thing in
/etc/zshenv or equivalent would be ideal).


setopt promptsubst
typeset -F SECONDS
PS4='+{$SECONDS}%N:%i> '


pws


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Opening a new tab is awkwardly slow
  2013-11-19 16:27   ` Timo Sand
  2013-11-19 16:40     ` Peter Stephenson
@ 2013-11-19 16:57     ` Bart Schaefer
  2013-11-20  6:18       ` Timo Sand
  1 sibling, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2013-11-19 16:57 UTC (permalink / raw)
  To: Timo Sand; +Cc: Zsh Users

On Tue, Nov 19, 2013 at 8:27 AM, Timo Sand <timo.j.sand@gmail.com> wrote:
> Here's the xtrace output https://gist.github.com/deiga/7547991
>
> Not sure how to debug this, any help would be appreciated :)

Well, to begin with, search for calls to the "git" and "nvm" functions.

I only see one call to "git":

+/Users/timosand/.zsh/system.zsh:9> git config --global
credential.helper osxkeychain
+git:0> hub config --global credential.helper osxkeychain

I know OSX keychain operations can be really slow sometimes; you might
want to consider doing that only once per desktop session rather than
on every shell.  Or put this in the background, if it's not directly
modifying the current shell environment.

The nvm activity seems to be from nvm.plugin.zsh, an oh-my-zsh module.

The problem with using modular configuration systems like oh-my-zsh is
that they encourage you to throw in all sorts of stuff that you might
use only once in a blue moon, or to try things and then forget you
have them enabled, so you're paying a continuous performance penalty
for an occasional convenience.  Part of the point of them being
modular is that things can be easily unplugged, too ...


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Opening a new tab is awkwardly slow
  2013-11-19 16:57     ` Bart Schaefer
@ 2013-11-20  6:18       ` Timo Sand
  2013-11-20  6:19         ` Timo Sand
  0 siblings, 1 reply; 8+ messages in thread
From: Timo Sand @ 2013-11-20  6:18 UTC (permalink / raw)
  Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1784 bytes --]

Okay, so I removed nvm from initialization and put the `git config` in the
background (should really move it to once per desktop session, but haven't
got an idea yet as to how I'd do that).

Also I added timing to the xtrace.

The biggest timesink seems to be that my `.zprofile` gets loaded twice and
thus `rbenv init` runs twice, which is kind of slow. The next would be
`compdef/compaudit`, but I don't even know what to do about them.


On 19 November 2013 18:57, Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Tue, Nov 19, 2013 at 8:27 AM, Timo Sand <timo.j.sand@gmail.com> wrote:
> > Here's the xtrace output https://gist.github.com/deiga/7547991
> >
> > Not sure how to debug this, any help would be appreciated :)
>
> Well, to begin with, search for calls to the "git" and "nvm" functions.
>
> I only see one call to "git":
>
> +/Users/timosand/.zsh/system.zsh:9> git config --global
> credential.helper osxkeychain
> +git:0> hub config --global credential.helper osxkeychain
>
> I know OSX keychain operations can be really slow sometimes; you might
> want to consider doing that only once per desktop session rather than
> on every shell.  Or put this in the background, if it's not directly
> modifying the current shell environment.
>
> The nvm activity seems to be from nvm.plugin.zsh, an oh-my-zsh module.
>
> The problem with using modular configuration systems like oh-my-zsh is
> that they encourage you to throw in all sorts of stuff that you might
> use only once in a blue moon, or to try things and then forget you
> have them enabled, so you're paying a continuous performance penalty
> for an occasional convenience.  Part of the point of them being
> modular is that things can be easily unplugged, too ...
>



-- 
Timo Sand
timo.j.sand+sig@gmail.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Opening a new tab is awkwardly slow
  2013-11-20  6:18       ` Timo Sand
@ 2013-11-20  6:19         ` Timo Sand
  2013-11-20 12:35           ` Peter Stephenson
  0 siblings, 1 reply; 8+ messages in thread
From: Timo Sand @ 2013-11-20  6:19 UTC (permalink / raw)
  Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]

Forgot to add the link

I updated the Gist content https://gist.github.com/deiga/7547991


On 20 November 2013 08:18, Timo Sand <timo.j.sand@gmail.com> wrote:

> Okay, so I removed nvm from initialization and put the `git config` in the
> background (should really move it to once per desktop session, but haven't
> got an idea yet as to how I'd do that).
>
>  Also I added timing to the xtrace.
>
> The biggest timesink seems to be that my `.zprofile` gets loaded twice and
> thus `rbenv init` runs twice, which is kind of slow. The next would be
> `compdef/compaudit`, but I don't even know what to do about them.
>
>
> On 19 November 2013 18:57, Bart Schaefer <schaefer@brasslantern.com>wrote:
>
>> On Tue, Nov 19, 2013 at 8:27 AM, Timo Sand <timo.j.sand@gmail.com> wrote:
>> > Here's the xtrace output https://gist.github.com/deiga/7547991
>> >
>> > Not sure how to debug this, any help would be appreciated :)
>>
>> Well, to begin with, search for calls to the "git" and "nvm" functions.
>>
>> I only see one call to "git":
>>
>> +/Users/timosand/.zsh/system.zsh:9> git config --global
>> credential.helper osxkeychain
>> +git:0> hub config --global credential.helper osxkeychain
>>
>> I know OSX keychain operations can be really slow sometimes; you might
>> want to consider doing that only once per desktop session rather than
>> on every shell.  Or put this in the background, if it's not directly
>> modifying the current shell environment.
>>
>> The nvm activity seems to be from nvm.plugin.zsh, an oh-my-zsh module.
>>
>> The problem with using modular configuration systems like oh-my-zsh is
>> that they encourage you to throw in all sorts of stuff that you might
>> use only once in a blue moon, or to try things and then forget you
>> have them enabled, so you're paying a continuous performance penalty
>> for an occasional convenience.  Part of the point of them being
>> modular is that things can be easily unplugged, too ...
>>
>
>
>
> --
> Timo Sand
> timo.j.sand+sig@gmail.com
>



-- 
Timo Sand
timo.j.sand+sig@gmail.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Opening a new tab is awkwardly slow
  2013-11-20  6:19         ` Timo Sand
@ 2013-11-20 12:35           ` Peter Stephenson
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Stephenson @ 2013-11-20 12:35 UTC (permalink / raw)
  To: Zsh Users

On Wed, 20 Nov 2013 08:19:25 +0200
Timo Sand <timo.j.sand@gmail.com> wrote:
> Forgot to add the link
> 
> I updated the Gist content https://gist.github.com/deiga/7547991

It would be useful if you were able to post a link to the text:  looking
at it in a browser widget isn't very convenient and we don't need the
versioning information.

> On 20 November 2013 08:18, Timo Sand <timo.j.sand@gmail.com> wrote:
> > The biggest timesink seems to be that my `.zprofile` gets loaded twice and
> > thus `rbenv init` runs twice, which is kind of slow. The next would be
> > `compdef/compaudit`, but I don't even know what to do about them.

You're getting to areas where you need specific help from whoever knows
what it is the script is trying to do, rather than zsh users generally.

However, as far as the "compdef"s are concerned --- the code is defining
these one by one as explicit compdef commands rather than using the
mechanism where the line "#compdef blah" appears in the first line of
the functions.  If you arrange to use that mechanism --- simply having
appropriate functions in you function search path when "compinit" is run
is sufficient --- this will be optimised to setting a single array in a
.zcompdump* dump file, which should be a good deal faster.

Whether that's something you're responsible for or is down to an init
file from someone else is, obviously, a question for you rather than me.

pws


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-11-20 12:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 10:51 Opening a new tab is awkwardly slow Timo Sand
2013-11-19 15:33 ` Bart Schaefer
2013-11-19 16:27   ` Timo Sand
2013-11-19 16:40     ` Peter Stephenson
2013-11-19 16:57     ` Bart Schaefer
2013-11-20  6:18       ` Timo Sand
2013-11-20  6:19         ` Timo Sand
2013-11-20 12:35           ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).