zsh-autosuggestions icon indicating copy to clipboard operation
zsh-autosuggestions copied to clipboard

Very slow on wsl2

Open eromoe opened this issue 5 years ago • 7 comments

Describe the bug

zprof detail

$ zprof
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)  194          26.20     0.14   39.05%     26.20     0.14   39.05%  _zsh_autosuggest_bind_widget
 2)    1          48.39    48.39   72.12%     22.19    22.19   33.07%  _zsh_autosuggest_bind_widgets
 3)    8           7.94     0.99   11.83%      4.65     0.58    6.93%  _zsh_highlight
 4)    1           3.15     3.15    4.69%      3.15     3.15    4.69%  _z_precmd
 5)    2           1.77     0.89    2.64%      1.18     0.59    1.77%  _zsh_highlight_main_highlighter_highlight_list
 6)    8           9.68     1.21   14.42%      1.12     0.14    1.66%  _zsh_highlight_call_widget
 7)    5           8.38     1.68   12.49%      1.01     0.20    1.51%  _zsh_autosuggest_widget_modify
 8)    1           0.83     0.83    1.23%      0.83     0.83    1.23%  _zsh_autosuggest_strategy_history
 9)    6           7.26     1.21   10.82%      0.79     0.13    1.18%  _zsh_autosuggest_invoke_original_widget
10)    2           2.94     1.47    4.38%      0.58     0.29    0.87%  _zsh_highlight_highlighter_main_paint
11)    5           7.08     1.42   10.55%      0.53     0.11    0.79%  _zsh_autosuggest_modify
12)    2           0.52     0.26    0.77%      0.52     0.26    0.77%  title
13)    2           0.38     0.19    0.57%      0.38     0.19    0.57%  _zsh_highlight_main_calculate_fallback
14)    5           0.36     0.07    0.53%      0.36     0.07    0.53%  url-quote-magic
15)    5           8.67     1.73   12.92%      0.29     0.06    0.43%  _zsh_autosuggest_bound_1_self-insert
16)    4           0.24     0.06    0.35%      0.24     0.06    0.35%  _zsh_highlight_main__type
17)    1           2.09     2.09    3.11%      0.23     0.23    0.34%  _zsh_autosuggest_widget_clear
18)    5           4.98     1.00    7.42%      0.22     0.04    0.32%  _zsh_highlight_widget_orig-s0.0000050000-r19059-self-insert
19)    6           0.21     0.04    0.32%      0.21     0.04    0.32%  _zsh_autosuggest_highlight_apply
20)    6           0.20     0.03    0.30%      0.20     0.03    0.30%  _zsh_autosuggest_highlight_reset
21)    2           0.20     0.10    0.30%      0.20     0.10    0.30%  _zsh_highlight_add_highlight
22)    1           0.20     0.20    0.29%      0.20     0.20    0.29%  _zsh_highlight_main__precmd_hook
23)    4           0.24     0.06    0.36%      0.16     0.04    0.24%  _zsh_highlight_highlighter_main_predicate
24)    2           0.16     0.08    0.24%      0.16     0.08    0.24%  _zsh_highlight_main_highlighter__try_expand_parameter
25)    1           0.36     0.36    0.53%      0.15     0.15    0.22%  omz_termsupport_preexec
26)    1           0.15     0.15    0.22%      0.15     0.15    0.22%  _zle_line_finish
27)    1           0.11     0.11    0.17%      0.11     0.11    0.17%  _zle_line_init
28)    1          48.50    48.50   72.28%      0.11     0.11    0.17%  _zsh_autosuggest_start
29)    4           0.10     0.03    0.16%      0.10     0.03    0.16%  (anon)
30)    1           0.41     0.41    0.61%      0.10     0.10    0.15%  omz_termsupport_precmd
31)    1           2.19     2.19    3.26%      0.10     0.10    0.15%  _zsh_autosuggest_bound_1_accept-line
32)    2           0.09     0.04    0.13%      0.09     0.04    0.13%  _zsh_highlight_main_add_region_highlight
33)    1           1.49     1.49    2.22%      0.09     0.09    0.13%  _zsh_highlight_widget_orig-s0.0000050000-r19059-accept-line
34)    3           0.08     0.03    0.12%      0.08     0.03    0.12%  _zsh_highlight_buffer_modified
35)    1           0.90     0.90    1.35%      0.08     0.08    0.11%  _zsh_autosuggest_fetch_suggestion
36)    2           0.07     0.04    0.11%      0.07     0.04    0.11%  _zsh_highlight_main_highlighter_expand_path
37)    1           0.98     0.98    1.45%      0.05     0.05    0.07%  _zsh_autosuggest_fetch
38)    1           1.73     1.73    2.57%      0.05     0.05    0.07%  _zsh_autosuggest_clear
39)    1           0.83     0.83    1.24%      0.05     0.05    0.07%  _zsh_highlight_widget_orig-s0.0000050000-r19059-zle-line-init
40)    1           2.77     2.77    4.13%      0.04     0.04    0.07%  _zsh_highlight_widget_orig-s0.0000050000-r19059-zle-line-finish
41)    1           0.03     0.03    0.05%      0.03     0.03    0.05%  _zsh_highlight_preexec_hook
42)    2           0.03     0.02    0.04%      0.03     0.02    0.04%  _zsh_highlight_main__is_redirection
43)    1           0.02     0.02    0.03%      0.02     0.02    0.03%  _zsh_autosuggest_suggest

Desktop

  • OS + distribution: wsl2 ubuntu 18.04
  • Zsh version: 5.4.2
  • Plugin version:

I don't know how to dig the problem .

eromoe avatar Jul 02 '20 15:07 eromoe

Hi, it looks like it's spending a lot of time in the bind functions. Have you tried disabling automatic widget re-binding? If that helps, this is probably a duplicate of #544

ericfreese avatar Jul 02 '20 17:07 ericfreese

$ zprof
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)    8           8.01     1.00   43.44%      4.59     0.57   24.88%  _zsh_highlight
 2)    1           2.10     2.10   11.38%      2.10     2.10   11.38%  _z_precmd
 3)    2           2.17     1.08   11.75%      1.46     0.73    7.90%  _zsh_highlight_main_highlighter_highlight_list
 4)    8          10.11     1.26   54.84%      1.44     0.18    7.83%  _zsh_highlight_call_widget
 5)    5          10.07     2.01   54.58%      1.10     0.22    5.97%  _zsh_autosuggest_widget_modify
 6)    6           8.21     1.37   44.53%      1.06     0.18    5.72%  _zsh_autosuggest_invoke_original_widget
 7)    1           0.95     0.95    5.16%      0.95     0.95    5.16%  _zsh_autosuggest_strategy_history
 8)    5           8.64     1.73   46.84%      0.67     0.13    3.61%  _zsh_autosuggest_modify
 9)    2           3.18     1.59   17.22%      0.60     0.30    3.28%  _zsh_highlight_highlighter_main_paint
10)    2           0.42     0.21    2.30%      0.42     0.21    2.30%  title
11)    5           0.42     0.08    2.26%      0.42     0.08    2.26%  url-quote-magic
12)    4           0.30     0.07    1.61%      0.30     0.07    1.61%  _zsh_highlight_main__type
13)    5          10.35     2.07   56.12%      0.28     0.06    1.54%  _zsh_autosuggest_bound_1_self-insert
14)    2           0.26     0.13    1.42%      0.26     0.13    1.42%  _zsh_highlight_main_calculate_fallback
15)    6           0.23     0.04    1.26%      0.23     0.04    1.26%  _zsh_autosuggest_highlight_reset
16)    5           5.98     1.20   32.44%      0.23     0.05    1.25%  _zsh_highlight_widget_orig-s0.0000050000-r28083-self-insert
17)    2           0.20     0.10    1.07%      0.20     0.10    1.07%  _zsh_highlight_main_highlighter__try_expand_parameter
18)    6           0.18     0.03    0.96%      0.18     0.03    0.96%  _zsh_autosuggest_highlight_apply
19)    1           1.69     1.69    9.17%      0.17     0.17    0.91%  _zsh_autosuggest_widget_clear
20)    1           0.33     0.33    1.80%      0.16     0.16    0.88%  omz_termsupport_preexec
21)    1           0.15     0.15    0.80%      0.15     0.15    0.80%  _zle_line_init
22)    1           0.14     0.14    0.78%      0.14     0.14    0.78%  _zsh_highlight_main__precmd_hook
23)    2           0.14     0.07    0.76%      0.14     0.07    0.76%  _zsh_highlight_add_highlight
24)    3           0.16     0.05    0.85%      0.11     0.04    0.58%  _zsh_highlight_highlighter_main_predicate
25)    1           0.36     0.36    1.93%      0.10     0.10    0.56%  omz_termsupport_precmd
26)    2           0.10     0.05    0.54%      0.10     0.05    0.54%  _zsh_highlight_main_add_region_highlight
27)    1           0.09     0.09    0.51%      0.09     0.09    0.51%  _zle_line_finish
28)    1           1.04     1.04    5.65%      0.09     0.09    0.49%  _zsh_autosuggest_fetch_suggestion
29)    3           0.09     0.03    0.49%      0.09     0.03    0.49%  (anon)
30)    2           0.08     0.04    0.42%      0.08     0.04    0.42%  _zsh_highlight_main_highlighter_expand_path
31)    1           1.17     1.17    6.37%      0.07     0.07    0.40%  _zsh_highlight_widget_orig-s0.0000050000-r28083-accept-line
32)    1           1.76     1.76    9.56%      0.07     0.07    0.39%  _zsh_autosuggest_bound_1_accept-line
33)    1           1.15     1.15    6.26%      0.07     0.07    0.38%  _zsh_autosuggest_fetch
34)    1           1.05     1.05    5.69%      0.07     0.07    0.36%  _zsh_highlight_widget_orig-s0.0000050000-r28083-zle-line-init
35)    2           0.05     0.03    0.27%      0.05     0.03    0.27%  _zsh_highlight_buffer_modified
36)    1           1.44     1.44    7.81%      0.05     0.05    0.25%  _zsh_autosuggest_clear
37)    1           0.04     0.04    0.23%      0.04     0.04    0.23%  _zsh_autosuggest_suggest
38)    2           0.04     0.02    0.21%      0.04     0.02    0.21%  _zsh_highlight_main__is_redirection
39)    1           0.03     0.03    0.19%      0.03     0.03    0.19%  _zsh_highlight_preexec_hook
40)    1           2.31     2.31   12.55%      0.03     0.03    0.19%  _zsh_highlight_widget_orig-s0.0000050000-r28083-zle-line-finish

-----------------------------------------------------------------------------------

13)    5          10.35     2.07   56.12%      0.28     0.06    1.54%  _zsh_autosuggest_bound_1_self-insert
       5/5        10.07     2.01   54.58%      1.10     0.22             _zsh_autosuggest_widget_modify [5]

-----------------------------------------------------------------------------------

       5/8         5.75     1.15   31.18%      0.97     0.19             _zsh_highlight_widget_orig-s0.0000050000-r28083-self-insert [16]
       1/8         2.28     2.28   12.36%      0.09     0.09             _zsh_highlight_widget_orig-s0.0000050000-r28083-zle-line-finish [40]
       1/8         1.10     1.10    5.97%      0.09     0.09             _zsh_highlight_widget_orig-s0.0000050000-r28083-accept-line [31]
       1/8         0.98     0.98    5.33%      0.29     0.29             _zsh_highlight_widget_orig-s0.0000050000-r28083-zle-line-init [34]
 4)    8          10.11     1.26   54.84%      1.44     0.18    7.83%  _zsh_highlight_call_widget
       1/1         0.09     0.09    0.51%      0.09     0.09             _zle_line_finish [27]
       1/1         0.15     0.15    0.80%      0.15     0.15             _zle_line_init [21]
       5/5         0.42     0.08    2.26%      0.42     0.08             url-quote-magic [11]
       8/8         8.01     1.00   43.44%      4.59     0.57             _zsh_highlight [1]

-----------------------------------------------------------------------------------

       5/5        10.07     2.01   54.58%      1.10     0.22             _zsh_autosuggest_bound_1_self-insert [13]
 5)    5          10.07     2.01   54.58%      1.10     0.22    5.97%  _zsh_autosuggest_widget_modify
       5/6         0.15     0.03    0.82%      0.15     0.03             _zsh_autosuggest_highlight_apply [18]
       5/6         0.17     0.03    0.95%      0.17     0.03             _zsh_autosuggest_highlight_reset [15]
       5/5         8.64     1.73   46.84%      0.67     0.13             _zsh_autosuggest_modify [8]

-----------------------------------------------------------------------------------

       5/5         8.64     1.73   46.84%      0.67     0.13             _zsh_autosuggest_widget_modify [5]
 8)    5           8.64     1.73   46.84%      0.67     0.13    3.61%  _zsh_autosuggest_modify
       1/1         1.15     1.15    6.26%      0.07     0.07             _zsh_autosuggest_fetch [33]
       5/6         6.82     1.36   36.97%      0.84     0.17             _zsh_autosuggest_invoke_original_widget [6]

-----------------------------------------------------------------------------------

       5/6         6.82     1.36   36.97%      0.84     0.17             _zsh_autosuggest_modify [8]
       1/6         1.39     1.39    7.56%      0.22     0.22             _zsh_autosuggest_clear [36]
 6)    6           8.21     1.37   44.53%      1.06     0.18    5.72%  _zsh_autosuggest_invoke_original_widget
       1/1         1.17     1.17    6.37%      0.07     0.07             _zsh_highlight_widget_orig-s0.0000050000-r28083-accept-line [31]
       5/5         5.98     1.20   32.44%      0.23     0.05             _zsh_highlight_widget_orig-s0.0000050000-r28083-self-insert [16]

-----------------------------------------------------------------------------------

       8/8         8.01     1.00   43.44%      4.59     0.57             _zsh_highlight_call_widget [4]
 1)    8           8.01     1.00   43.44%      4.59     0.57   24.88%  _zsh_highlight
       3/3         0.09     0.03    0.49%      0.09     0.03             (anon) [29]
       3/3         0.16     0.05    0.85%      0.11     0.04             _zsh_highlight_highlighter_main_predicate [24]
       2/2         3.18     1.59   17.22%      0.60     0.30             _zsh_highlight_highlighter_main_paint [9]

-----------------------------------------------------------------------------------

       5/5         5.98     1.20   32.44%      0.23     0.05             _zsh_autosuggest_invoke_original_widget [6]
16)    5           5.98     1.20   32.44%      0.23     0.05    1.25%  _zsh_highlight_widget_orig-s0.0000050000-r28083-self-insert
       5/8         5.75     1.15   31.18%      0.97     0.19             _zsh_highlight_call_widget [4]

-----------------------------------------------------------------------------------

       2/2         3.18     1.59   17.22%      0.60     0.30             _zsh_highlight [1]
 9)    2           3.18     1.59   17.22%      0.60     0.30    3.28%  _zsh_highlight_highlighter_main_paint
       2/2         0.14     0.07    0.76%      0.14     0.07             _zsh_highlight_add_highlight [23]
       2/2         0.26     0.13    1.42%      0.26     0.13             _zsh_highlight_main_calculate_fallback [14]
       2/2         2.17     1.08   11.75%      1.46     0.73             _zsh_highlight_main_highlighter_highlight_list [3]

-----------------------------------------------------------------------------------

40)    1           2.31     2.31   12.55%      0.03     0.03    0.19%  _zsh_highlight_widget_orig-s0.0000050000-r28083-zle-line-finish
       1/8         2.28     2.28   12.36%      0.09     0.09             _zsh_highlight_call_widget [4]

-----------------------------------------------------------------------------------

       2/2         2.17     1.08   11.75%      1.46     0.73             _zsh_highlight_highlighter_main_paint [9]
 3)    2           2.17     1.08   11.75%      1.46     0.73    7.90%  _zsh_highlight_main_highlighter_highlight_list
       2/2         0.04     0.02    0.21%      0.04     0.02             _zsh_highlight_main__is_redirection [38]
       2/2         0.08     0.04    0.42%      0.08     0.04             _zsh_highlight_main_highlighter_expand_path [30]
       2/2         0.10     0.05    0.54%      0.10     0.05             _zsh_highlight_main_add_region_highlight [26]
       2/2         0.20     0.10    1.07%      0.20     0.10             _zsh_highlight_main_highlighter__try_expand_parameter [17]
       4/4         0.30     0.07    1.61%      0.30     0.07             _zsh_highlight_main__type [12]

-----------------------------------------------------------------------------------

 2)    1           2.10     2.10   11.38%      2.10     2.10   11.38%  _z_precmd

-----------------------------------------------------------------------------------

32)    1           1.76     1.76    9.56%      0.07     0.07    0.39%  _zsh_autosuggest_bound_1_accept-line
       1/1         1.69     1.69    9.17%      0.17     0.17             _zsh_autosuggest_widget_clear [19]

-----------------------------------------------------------------------------------

       1/1         1.69     1.69    9.17%      0.17     0.17             _zsh_autosuggest_bound_1_accept-line [32]
19)    1           1.69     1.69    9.17%      0.17     0.17    0.91%  _zsh_autosuggest_widget_clear
       1/6         0.02     0.02    0.14%      0.02     0.02             _zsh_autosuggest_highlight_apply [18]
       1/6         0.06     0.06    0.31%      0.06     0.06             _zsh_autosuggest_highlight_reset [15]
       1/1         1.44     1.44    7.81%      0.05     0.05             _zsh_autosuggest_clear [36]

-----------------------------------------------------------------------------------

       1/1         1.44     1.44    7.81%      0.05     0.05             _zsh_autosuggest_widget_clear [19]
36)    1           1.44     1.44    7.81%      0.05     0.05    0.25%  _zsh_autosuggest_clear
       1/6         1.39     1.39    7.56%      0.22     0.22             _zsh_autosuggest_invoke_original_widget [6]

-----------------------------------------------------------------------------------

       1/1         1.17     1.17    6.37%      0.07     0.07             _zsh_autosuggest_invoke_original_widget [6]
31)    1           1.17     1.17    6.37%      0.07     0.07    0.40%  _zsh_highlight_widget_orig-s0.0000050000-r28083-accept-line
       1/8         1.10     1.10    5.97%      0.09     0.09             _zsh_highlight_call_widget [4]

-----------------------------------------------------------------------------------

       1/1         1.15     1.15    6.26%      0.07     0.07             _zsh_autosuggest_modify [8]
33)    1           1.15     1.15    6.26%      0.07     0.07    0.38%  _zsh_autosuggest_fetch
       1/1         0.04     0.04    0.23%      0.04     0.04             _zsh_autosuggest_suggest [37]
       1/1         1.04     1.04    5.65%      0.09     0.09             _zsh_autosuggest_fetch_suggestion [28]

-----------------------------------------------------------------------------------

34)    1           1.05     1.05    5.69%      0.07     0.07    0.36%  _zsh_highlight_widget_orig-s0.0000050000-r28083-zle-line-init
       1/8         0.98     0.98    5.33%      0.29     0.29             _zsh_highlight_call_widget [4]

-----------------------------------------------------------------------------------

       1/1         1.04     1.04    5.65%      0.09     0.09             _zsh_autosuggest_fetch [33]
28)    1           1.04     1.04    5.65%      0.09     0.09    0.49%  _zsh_autosuggest_fetch_suggestion
       1/1         0.95     0.95    5.16%      0.95     0.95             _zsh_autosuggest_strategy_history [7]

-----------------------------------------------------------------------------------

       1/1         0.95     0.95    5.16%      0.95     0.95             _zsh_autosuggest_fetch_suggestion [28]
 7)    1           0.95     0.95    5.16%      0.95     0.95    5.16%  _zsh_autosuggest_strategy_history

-----------------------------------------------------------------------------------

       1/2         0.25     0.25    1.37%      0.25     0.25             omz_termsupport_precmd [25]
       1/2         0.17     0.17    0.92%      0.17     0.17             omz_termsupport_preexec [20]
10)    2           0.42     0.21    2.30%      0.42     0.21    2.30%  title

-----------------------------------------------------------------------------------

       5/5         0.42     0.08    2.26%      0.42     0.08             _zsh_highlight_call_widget [4]
11)    5           0.42     0.08    2.26%      0.42     0.08    2.26%  url-quote-magic

-----------------------------------------------------------------------------------

25)    1           0.36     0.36    1.93%      0.10     0.10    0.56%  omz_termsupport_precmd
       1/2         0.25     0.25    1.37%      0.25     0.25             title [10]

-----------------------------------------------------------------------------------

20)    1           0.33     0.33    1.80%      0.16     0.16    0.88%  omz_termsupport_preexec
       1/2         0.17     0.17    0.92%      0.17     0.17             title [10]

-----------------------------------------------------------------------------------

       4/4         0.30     0.07    1.61%      0.30     0.07             _zsh_highlight_main_highlighter_highlight_list [3]
12)    4           0.30     0.07    1.61%      0.30     0.07    1.61%  _zsh_highlight_main__type

-----------------------------------------------------------------------------------

       2/2         0.26     0.13    1.42%      0.26     0.13             _zsh_highlight_highlighter_main_paint [9]
14)    2           0.26     0.13    1.42%      0.26     0.13    1.42%  _zsh_highlight_main_calculate_fallback

-----------------------------------------------------------------------------------

       5/6         0.17     0.03    0.95%      0.17     0.03             _zsh_autosuggest_widget_modify [5]
       1/6         0.06     0.06    0.31%      0.06     0.06             _zsh_autosuggest_widget_clear [19]
15)    6           0.23     0.04    1.26%      0.23     0.04    1.26%  _zsh_autosuggest_highlight_reset

-----------------------------------------------------------------------------------

       2/2         0.20     0.10    1.07%      0.20     0.10             _zsh_highlight_main_highlighter_highlight_list [3]
17)    2           0.20     0.10    1.07%      0.20     0.10    1.07%  _zsh_highlight_main_highlighter__try_expand_parameter

-----------------------------------------------------------------------------------

       5/6         0.15     0.03    0.82%      0.15     0.03             _zsh_autosuggest_widget_modify [5]
       1/6         0.02     0.02    0.14%      0.02     0.02             _zsh_autosuggest_widget_clear [19]
18)    6           0.18     0.03    0.96%      0.18     0.03    0.96%  _zsh_autosuggest_highlight_apply

-----------------------------------------------------------------------------------

       3/3         0.16     0.05    0.85%      0.11     0.04             _zsh_highlight [1]
24)    3           0.16     0.05    0.85%      0.11     0.04    0.58%  _zsh_highlight_highlighter_main_predicate
       2/2         0.05     0.03    0.27%      0.05     0.03             _zsh_highlight_buffer_modified [35]

-----------------------------------------------------------------------------------

       1/1         0.15     0.15    0.80%      0.15     0.15             _zsh_highlight_call_widget [4]
21)    1           0.15     0.15    0.80%      0.15     0.15    0.80%  _zle_line_init

-----------------------------------------------------------------------------------

22)    1           0.14     0.14    0.78%      0.14     0.14    0.78%  _zsh_highlight_main__precmd_hook

-----------------------------------------------------------------------------------

       2/2         0.14     0.07    0.76%      0.14     0.07             _zsh_highlight_highlighter_main_paint [9]
23)    2           0.14     0.07    0.76%      0.14     0.07    0.76%  _zsh_highlight_add_highlight

-----------------------------------------------------------------------------------

       2/2         0.10     0.05    0.54%      0.10     0.05             _zsh_highlight_main_highlighter_highlight_list [3]
26)    2           0.10     0.05    0.54%      0.10     0.05    0.54%  _zsh_highlight_main_add_region_highlight

-----------------------------------------------------------------------------------

       1/1         0.09     0.09    0.51%      0.09     0.09             _zsh_highlight_call_widget [4]
27)    1           0.09     0.09    0.51%      0.09     0.09    0.51%  _zle_line_finish

-----------------------------------------------------------------------------------

       3/3         0.09     0.03    0.49%      0.09     0.03             _zsh_highlight [1]
29)    3           0.09     0.03    0.49%      0.09     0.03    0.49%  (anon)

-----------------------------------------------------------------------------------

       2/2         0.08     0.04    0.42%      0.08     0.04             _zsh_highlight_main_highlighter_highlight_list [3]
30)    2           0.08     0.04    0.42%      0.08     0.04    0.42%  _zsh_highlight_main_highlighter_expand_path

-----------------------------------------------------------------------------------

       2/2         0.05     0.03    0.27%      0.05     0.03             _zsh_highlight_highlighter_main_predicate [24]
35)    2           0.05     0.03    0.27%      0.05     0.03    0.27%  _zsh_highlight_buffer_modified

-----------------------------------------------------------------------------------

       1/1         0.04     0.04    0.23%      0.04     0.04             _zsh_autosuggest_fetch [33]
37)    1           0.04     0.04    0.23%      0.04     0.04    0.23%  _zsh_autosuggest_suggest

-----------------------------------------------------------------------------------

       2/2         0.04     0.02    0.21%      0.04     0.02             _zsh_highlight_main_highlighter_highlight_list [3]
38)    2           0.04     0.02    0.21%      0.04     0.02    0.21%  _zsh_highlight_main__is_redirection

-----------------------------------------------------------------------------------

39)    1           0.03     0.03    0.19%      0.03     0.03    0.19%  _zsh_highlight_preexec_hook

I don't quite understand the 3 columns under time .

eromoe avatar Jul 03 '20 13:07 eromoe

I am also experiencing very poor performance on WSL2. However, performance is only poor while trying to complete paths on the filesystem. Completion for other things such as set -<TAB> respond instantly.

For example, ./bin<TAB> to complete to ./binary_filename will hang for a very long time, 5-10+ seconds to complete.

Collapsed zprof log, click to expand

zprof log

num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)    1       12319.84 12319.84   99.80%  12074.31 12074.31   97.81%  _path_commands
 2)    7         246.65    35.24    2.00%    243.71    34.82    1.97%  _all_labels
 3)   31           8.18     0.26    0.07%      5.38     0.17    0.04%  _description
 4)    4           6.87     1.72    0.06%      3.97     0.99    0.03%  _parameters
 5)   32           2.97     0.09    0.02%      2.97     0.09    0.02%  _setup
 6)    1       12338.26 12338.26   99.94%      2.45     2.45    0.02%  _alternative
 7)   12           1.73     0.14    0.01%      1.73     0.14    0.01%  url-quote-magic
 8)    3           1.77     0.59    0.01%      1.68     0.56    0.01%  _path_files
 9)   26           4.54     0.17    0.04%      1.13     0.04    0.01%  _next_label
10)   28           1.07     0.04    0.01%      1.07     0.04    0.01%  _tags
11)    7         248.43    35.49    2.01%      0.94     0.13    0.01%  _wanted
12)    1       12339.59 12339.59   99.96%      0.77     0.77    0.01%  _main_complete
13)    3           1.14     0.38    0.01%      0.57     0.19    0.00%  azhw:zle-line-finish
14)    5           0.52     0.10    0.00%      0.52     0.10    0.00%  prompt_pure_set_title
15)    1           2.38     2.38    0.02%      0.41     0.41    0.00%  _files
16)    3           0.40     0.13    0.00%      0.40     0.13    0.00%  prompt_pure_preprompt_render
17)    3           1.80     0.60    0.01%      0.37     0.12    0.00%  prompt_pure_precmd
18)    3           0.42     0.14    0.00%      0.35     0.12    0.00%  zle-line-finish
19)    3           0.33     0.11    0.00%      0.28     0.09    0.00%  zle-line-init
20)    3           0.27     0.09    0.00%      0.27     0.09    0.00%  async_job
21)    1       12339.86 12339.86   99.96%      0.27     0.27    0.00%  expand-or-complete-with-indicator
22)   10           0.25     0.02    0.00%      0.25     0.02    0.00%  _requested
23)    3           0.51     0.17    0.00%      0.23     0.08    0.00%  prompt_pure_async_tasks
24)    6           0.22     0.04    0.00%      0.22     0.04    0.00%  prompt_pure_reset_vim_prompt
25)    6           0.13     0.02    0.00%      0.13     0.02    0.00%  editor-info
26)    2           0.27     0.14    0.00%      0.11     0.06    0.00%  prompt_pure_preexec
27)    3           0.10     0.03    0.00%      0.10     0.03    0.00%  prompt_pure_check_cmd_exec_time
28)    4           0.09     0.02    0.00%      0.09     0.02    0.00%  _have_glob_qual
29)    1       12338.66 12338.66   99.95%      0.09     0.09    0.00%  _complete
30)    1       12338.56 12338.56   99.95%      0.09     0.09    0.00%  _normal
31)    1       12338.35 12338.35   99.94%      0.09     0.09    0.00%  _command_names
32)    1           0.06     0.06    0.00%      0.06     0.06    0.00%  _cd
33)    1       12338.47 12338.47   99.95%      0.05     0.05    0.00%  _autocd
34)    1           0.02     0.02    0.00%      0.02     0.02    0.00%  _list_files
35)    1           0.02     0.02    0.00%      0.02     0.02    0.00%  _jobs
36)    1           0.01     0.01    0.00%      0.01     0.01    0.00%  _suffix_alias_files
37)    1           0.01     0.01    0.00%      0.01     0.01    0.00%  _first

-----------------------------------------------------------------------------------

21)    1       12339.86 12339.86   99.96%      0.27     0.27    0.00%  expand-or-complete-with-indicator
       1/1     12339.59 12339.59   99.96%      0.77     0.77             _main_complete [12]

-----------------------------------------------------------------------------------

       1/1     12339.59 12339.59   99.96%      0.77     0.77             expand-or-complete-with-indicator [21]
12)    1       12339.59 12339.59   99.96%      0.77     0.77    0.01%  _main_complete
       1/32        0.17     0.17    0.00%      0.17     0.17             _setup [5]
       1/1     12338.66 12338.66   99.95%      0.09     0.09             _complete [29]

-----------------------------------------------------------------------------------

       1/1     12338.66 12338.66   99.95%      0.09     0.09             _main_complete [12]
29)    1       12338.66 12338.66   99.95%      0.09     0.09    0.00%  _complete
       1/1         0.01     0.01    0.00%      0.01     0.01             _first [37]
       1/1     12338.56 12338.56   99.95%      0.09     0.09             _normal [30]

-----------------------------------------------------------------------------------

       1/1     12338.56 12338.56   99.95%      0.09     0.09             _complete [29]
30)    1       12338.56 12338.56   99.95%      0.09     0.09    0.00%  _normal
       1/1     12338.47 12338.47   99.95%      0.05     0.05             _autocd [33]

-----------------------------------------------------------------------------------

       1/1     12338.47 12338.47   99.95%      0.05     0.05             _normal [30]
33)    1       12338.47 12338.47   99.95%      0.05     0.05    0.00%  _autocd
       1/1         0.06     0.06    0.00%      0.06     0.06             _cd [32]
       1/1     12338.35 12338.35   99.94%      0.09     0.09             _command_names [31]

-----------------------------------------------------------------------------------

       1/1     12338.35 12338.35   99.94%      0.09     0.09             _autocd [33]
31)    1       12338.35 12338.35   99.94%      0.09     0.09    0.00%  _command_names
       1/1     12338.26 12338.26   99.94%      2.45     2.45             _alternative [6]

-----------------------------------------------------------------------------------

       1/1     12338.26 12338.26   99.94%      2.45     2.45             _command_names [31]
 6)    1       12338.26 12338.26   99.94%      2.45     2.45    0.02%  _alternative
       1/1         0.01     0.01    0.00%      0.01     0.01             _suffix_alias_files [36]
       1/1         0.02     0.02    0.00%      0.02     0.02             _jobs [35]
       2/28        0.08     0.04    0.00%      0.08     0.04             _tags [10]
      10/10        0.25     0.02    0.00%      0.25     0.02             _requested [22]
       1/1         2.38     2.38    0.02%      0.41     0.41             _files [15]
      10/31        2.50     0.25    0.02%      1.68     0.17             _description [3]
      22/26        3.86     0.18    0.03%      0.94     0.04             _next_label [9]
       4/4         6.87     1.72    0.06%      3.97     0.99             _parameters [4]
       1/1     12319.84 12319.84   99.80%  12074.31 12074.31             _path_commands [1]

-----------------------------------------------------------------------------------

       1/1     12319.84 12319.84   99.80%  12074.31 12074.31             _alternative [6]
 1)    1       12319.84 12319.84   99.80%  12074.31 12074.31   97.81%  _path_commands
       3/7       245.53    81.84    1.99%      0.39     0.13             _wanted [11]

-----------------------------------------------------------------------------------

       3/7       245.53    81.84    1.99%      0.39     0.13             _path_commands [1]
       4/7         2.91     0.73    0.02%      0.55     0.14             _parameters [4]
11)    7         248.43    35.49    2.01%      0.94     0.13    0.01%  _wanted
      21/28        0.84     0.04    0.01%      0.84     0.04             _tags [10]
       7/7       246.65    35.24    2.00%    243.71    34.82             _all_labels [2]

-----------------------------------------------------------------------------------

       7/7       246.65    35.24    2.00%    243.71    34.82             _wanted [11]
 2)    7         246.65    35.24    2.00%    243.71    34.82    1.97%  _all_labels
       1/3         0.66     0.66    0.01%      0.64     0.64             _path_files [8]
       7/31        2.28     0.33    0.02%      1.44     0.21             _description [3]

-----------------------------------------------------------------------------------

      14/31        3.41     0.24    0.03%      2.26     0.16             _next_label [9]
      10/31        2.50     0.25    0.02%      1.68     0.17             _alternative [6]
       7/31        2.28     0.33    0.02%      1.44     0.21             _all_labels [2]
 3)   31           8.18     0.26    0.07%      5.38     0.17    0.04%  _description
      31/32        2.81     0.09    0.02%      2.81     0.09             _setup [5]

-----------------------------------------------------------------------------------

       4/4         6.87     1.72    0.06%      3.97     0.99             _alternative [6]
 4)    4           6.87     1.72    0.06%      3.97     0.99    0.03%  _parameters
       4/7         2.91     0.73    0.02%      0.55     0.14             _wanted [11]

-----------------------------------------------------------------------------------

      22/26        3.86     0.18    0.03%      0.94     0.04             _alternative [6]
       4/26        0.68     0.17    0.01%      0.19     0.05             _files [15]
 9)   26           4.54     0.17    0.04%      1.13     0.04    0.01%  _next_label
      14/31        3.41     0.24    0.03%      2.26     0.16             _description [3]

-----------------------------------------------------------------------------------

      31/32        2.81     0.09    0.02%      2.81     0.09             _description [3]
       1/32        0.17     0.17    0.00%      0.17     0.17             _main_complete [12]
 5)   32           2.97     0.09    0.02%      2.97     0.09    0.02%  _setup

-----------------------------------------------------------------------------------

       1/1         2.38     2.38    0.02%      0.41     0.41             _alternative [6]
15)    1           2.38     2.38    0.02%      0.41     0.41    0.00%  _files
       1/4         0.02     0.02    0.00%      0.02     0.02             _have_glob_qual [28]
       5/28        0.15     0.03    0.00%      0.15     0.03             _tags [10]
       4/26        0.68     0.17    0.01%      0.19     0.05             _next_label [9]
       2/3         1.11     0.55    0.01%      1.04     0.52             _path_files [8]

-----------------------------------------------------------------------------------

17)    3           1.80     0.60    0.01%      0.37     0.12    0.00%  prompt_pure_precmd
       3/6         0.07     0.02    0.00%      0.07     0.02             prompt_pure_reset_vim_prompt [24]
       3/3         0.10     0.03    0.00%      0.10     0.03             prompt_pure_check_cmd_exec_time [27]
       3/5         0.35     0.12    0.00%      0.35     0.12             prompt_pure_set_title [14]
       3/3         0.40     0.13    0.00%      0.40     0.13             prompt_pure_preprompt_render [16]
       3/3         0.51     0.17    0.00%      0.23     0.08             prompt_pure_async_tasks [23]

-----------------------------------------------------------------------------------

       2/3         1.11     0.55    0.01%      1.04     0.52             _files [15]
       1/3         0.66     0.66    0.01%      0.64     0.64             _all_labels [2]
 8)    3           1.77     0.59    0.01%      1.68     0.56    0.01%  _path_files
       1/1         0.02     0.02    0.00%      0.02     0.02             _list_files [34]
       3/4         0.07     0.02    0.00%      0.07     0.02             _have_glob_qual [28]

-----------------------------------------------------------------------------------

 7)   12           1.73     0.14    0.01%      1.73     0.14    0.01%  url-quote-magic

-----------------------------------------------------------------------------------

13)    3           1.14     0.38    0.01%      0.57     0.19    0.00%  azhw:zle-line-finish
       3/6         0.15     0.05    0.00%      0.15     0.05             prompt_pure_reset_vim_prompt [24]
       3/3         0.42     0.14    0.00%      0.35     0.12             zle-line-finish [18]

-----------------------------------------------------------------------------------

      21/28        0.84     0.04    0.01%      0.84     0.04             _wanted [11]
       5/28        0.15     0.03    0.00%      0.15     0.03             _files [15]
       2/28        0.08     0.04    0.00%      0.08     0.04             _alternative [6]
10)   28           1.07     0.04    0.01%      1.07     0.04    0.01%  _tags

-----------------------------------------------------------------------------------

       3/5         0.35     0.12    0.00%      0.35     0.12             prompt_pure_precmd [17]
       2/5         0.16     0.08    0.00%      0.16     0.08             prompt_pure_preexec [26]
14)    5           0.52     0.10    0.00%      0.52     0.10    0.00%  prompt_pure_set_title

-----------------------------------------------------------------------------------

       3/3         0.51     0.17    0.00%      0.23     0.08             prompt_pure_precmd [17]
23)    3           0.51     0.17    0.00%      0.23     0.08    0.00%  prompt_pure_async_tasks
       3/3         0.27     0.09    0.00%      0.27     0.09             async_job [20]

-----------------------------------------------------------------------------------

       3/3         0.42     0.14    0.00%      0.35     0.12             azhw:zle-line-finish [13]
18)    3           0.42     0.14    0.00%      0.35     0.12    0.00%  zle-line-finish
       3/6         0.08     0.03    0.00%      0.08     0.03             editor-info [25]

-----------------------------------------------------------------------------------

       3/3         0.40     0.13    0.00%      0.40     0.13             prompt_pure_precmd [17]
16)    3           0.40     0.13    0.00%      0.40     0.13    0.00%  prompt_pure_preprompt_render

-----------------------------------------------------------------------------------

19)    3           0.33     0.11    0.00%      0.28     0.09    0.00%  zle-line-init
       3/6         0.06     0.02    0.00%      0.06     0.02             editor-info [25]

-----------------------------------------------------------------------------------

       3/3         0.27     0.09    0.00%      0.27     0.09             prompt_pure_async_tasks [23]
20)    3           0.27     0.09    0.00%      0.27     0.09    0.00%  async_job

-----------------------------------------------------------------------------------

26)    2           0.27     0.14    0.00%      0.11     0.06    0.00%  prompt_pure_preexec
       2/5         0.16     0.08    0.00%      0.16     0.08             prompt_pure_set_title [14]

-----------------------------------------------------------------------------------

      10/10        0.25     0.02    0.00%      0.25     0.02             _alternative [6]
22)   10           0.25     0.02    0.00%      0.25     0.02    0.00%  _requested

-----------------------------------------------------------------------------------

       3/6         0.15     0.05    0.00%      0.15     0.05             azhw:zle-line-finish [13]
       3/6         0.07     0.02    0.00%      0.07     0.02             prompt_pure_precmd [17]
24)    6           0.22     0.04    0.00%      0.22     0.04    0.00%  prompt_pure_reset_vim_prompt

-----------------------------------------------------------------------------------

       3/6         0.08     0.03    0.00%      0.08     0.03             zle-line-finish [18]
       3/6         0.06     0.02    0.00%      0.06     0.02             zle-line-init [19]
25)    6           0.13     0.02    0.00%      0.13     0.02    0.00%  editor-info

-----------------------------------------------------------------------------------

       3/3         0.10     0.03    0.00%      0.10     0.03             prompt_pure_precmd [17]
27)    3           0.10     0.03    0.00%      0.10     0.03    0.00%  prompt_pure_check_cmd_exec_time

-----------------------------------------------------------------------------------

       3/4         0.07     0.02    0.00%      0.07     0.02             _path_files [8]
       1/4         0.02     0.02    0.00%      0.02     0.02             _files [15]
28)    4           0.09     0.02    0.00%      0.09     0.02    0.00%  _have_glob_qual

-----------------------------------------------------------------------------------

       1/1         0.06     0.06    0.00%      0.06     0.06             _autocd [33]
32)    1           0.06     0.06    0.00%      0.06     0.06    0.00%  _cd

-----------------------------------------------------------------------------------

       1/1         0.02     0.02    0.00%      0.02     0.02             _path_files [8]
34)    1           0.02     0.02    0.00%      0.02     0.02    0.00%  _list_files

-----------------------------------------------------------------------------------

       1/1         0.02     0.02    0.00%      0.02     0.02             _alternative [6]
35)    1           0.02     0.02    0.00%      0.02     0.02    0.00%  _jobs

-----------------------------------------------------------------------------------

       1/1         0.01     0.01    0.00%      0.01     0.01             _alternative [6]
36)    1           0.01     0.01    0.00%      0.01     0.01    0.00%  _suffix_alias_files

-----------------------------------------------------------------------------------

       1/1         0.01     0.01    0.00%      0.01     0.01             _complete [29]
37)    1           0.01     0.01    0.00%      0.01     0.01    0.00%  _first

xaviergmail avatar Aug 08 '20 20:08 xaviergmail

I am also experiencing very poor performance on WSL2. However, performance is only poor while trying to complete paths on the filesystem. Completion for other things such as set -<TAB> respond instantly.

I experience basically the same and wanted to point out that completion of commands (i.e. ss<tab>) is slow aswell but completion of options is fast again (i.e. ssh <tab>).

okin avatar Sep 15 '21 08:09 okin

I am also experiencing very poor performance on WSL2.

zeljkomarinkovic avatar Oct 29 '21 08:10 zeljkomarinkovic

I am also experiencing very poor performance on WSL2.

try unsetopt PATH_DIRS for wsl2

dhruvinsh avatar Apr 26 '22 18:04 dhruvinsh

Very good pointer, @dhruvinsh!

When checking my PATH this seems to be inherited from the Windows system and contains entires like /mnt/c/WINDOWS which contain more than a few directories.

Unsetting PATH_DIRS in a running shell solves the problem for me.

~~The completion module I use uses setopt PATH_DIRS in its init. Could this be the culprit?~~

okin avatar Apr 28 '22 09:04 okin