zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

Please optimize loading z-sy-h (time to first prompt in a new shell)

Open zachliu opened this issue 6 years ago • 7 comments
trafficstars

I'm all about startup speed, but:

um  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)    1          32.18    32.18   49.28%     32.18    32.18   49.28%  _zsh_highlight_bind_widgets
 2)    1           9.25     9.25   14.16%      9.25     9.25   14.16%  compinit
 3)    1           7.50     7.50   11.48%      6.88     6.88   10.54%  _zsh_highlight_load_highlighters
 4)    8           5.90     0.74    9.03%      5.90     0.74    9.03%  compdef
 5)    1           4.63     4.63    7.10%      4.63     4.63    7.10%  include
 6)    5           2.06     0.41    3.16%      2.06     0.41    3.16%  add-zsh-hook
 7)    4           5.09     1.27    7.79%      1.23     0.31    1.89%  complete
 8)    1           1.15     1.15    1.76%      1.15     1.15    1.76%  is-at-least
 9)    3           0.57     0.19    0.88%      0.57     0.19    0.88%  bashcompinit
10)    5           0.50     0.10    0.76%      0.50     0.10    0.76%  spaceship::deprecated

Any suggestions?

zachliu avatar Oct 04 '19 18:10 zachliu

:crying_cat_face:

zachliu avatar Oct 04 '19 18:10 zachliu

Try the features/redrawhook branch.

danielshahaf avatar Oct 04 '19 18:10 danielshahaf

Hey, just out of curiosity, how did you perform this test?

doronbehar avatar Oct 13 '19 10:10 doronbehar

Presumably with zprof — it's documented in the zsh manual.

danielshahaf avatar Oct 13 '19 16:10 danielshahaf

@danielshahaf lowered from ~60% to less than 20% :+1:

zachliu avatar Oct 14 '19 15:10 zachliu

Thanks. We should release 0.7.0, merge the branch, and then look into those 20%.

danielshahaf avatar Oct 14 '19 16:10 danielshahaf

Some more analysis in a comment on a recent issue that's a duplicate of this one: https://github.com/zsh-users/zsh-syntax-highlighting/issues/734#issuecomment-630979611

danielshahaf avatar May 22 '20 01:05 danielshahaf