Support request: zsh load is slow #123
-
Checks
Expected behaviour
Actual behaviourCurrently it takes about a second before one can type any command. It was not this noticeable on fig. And it seems like the shell is init twice -- so if you start typing just after opening, a part of command is lost. Can the performance of code whisperer be improved? Maybe some parts can use zsh_async or something 👀 Edit: Sometimes it's faster -- like under 200-300ms. Is this dependent on network? Steps to reproduceAdd this to top and bottom of echo start - "$(perl -MTime::HiRes=time -e 'printf "%.9f\n", time')"
# codewhisperer stuff
echo end - "$(perl -MTime::HiRes=time -e 'printf "%.9f\n", time')" One can get stuff like this:
You can also try
zprof doesn't show anything useful EnvironmentCODEWHISPERER-details:
- 0.15.1
hardware-info:
- model:
- model-id:
- chip-id: Apple M2 Pro
- cores: 10
- mem: 16.00 GB
os-info:
- macOS 14.4.0 (23E214)
environment:
- shell: /bin/zsh
- terminal: vscode
- cwd: /Users/divyansh/foo
- exe-path: /Users/divyansh/.local/bin/cw
- install-method: brew
- env-vars:
- CWTERM_SESSION_ID: ac365cc8f36f495e8a43c0e957a8f20d
- CW_SET_PARENT: ac365cc8f36f495e8a43c0e957a8f20d
- CW_SET_PARENT_CHECK: 1
- CW_TERM: 0.15.1
- PATH: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/divyansh/.composer/vendor/bin:/Users/divyansh/.deno/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/divyansh/.local/bin:/Users/divyansh/Library/Application Support/JetBrains/Toolbox/scripts
- SHELL: /bin/zsh
- TERM: xterm-256color
- ZDOTDIR: /Users/divyansh
- __CFBundleIdentifier: com.microsoft.VSCode |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
Seconding this |
Beta Was this translation helpful? Give feedback.
-
My zsh startup is very slow, but after closing CW it will return to normal startup speed |
Beta Was this translation helpful? Give feedback.
-
Seconding this |
Beta Was this translation helpful? Give feedback.
-
I will investigate this issue |
Beta Was this translation helpful? Give feedback.
-
Same issue here. I debugged my entire ZSH config to double check, and CW is the the main issue.
I tried toggling every other block from my config, none of them has a significant impact like CW has (as you can see slowing down by 200%). This is a major blocker for me as I recently switched from p10k to Starship and I no longer have instant prompt. |
Beta Was this translation helpful? Give feedback.
-
Seconding this. Using fish shell: fish --profile-startup /tmp/startup.prof
sort -nk2 /tmp/startup.prof | tail -n 15 Codewhisperer is by far what takes the longest time. 7189 13837 -> starship init fish | source
88 25546 > builtin source /Users/christofferbergj/.config/fish/config.fish
520 45169 --------> for func in (functions -n)...
6 45180 -------> if not set -q argv[1]...
11 45214 ------> alias
782 45996 -----> command cw _ pre-cmd --alias (alias) &> /dev/null &
4 46000 ----> begin...
# culprit here
163129 163129 ----> ~/.local/bin/cw init fish post --rcfile 99_fig_post | string split0
188559 188559 ----> ~/.local/bin/cw init fish pre --rcfile 00_fig_pre | string split0
173 190026 ---> eval (~/.local/bin/cw init fish pre --rcfile 00_fig_pre | string split0)
67 190131 --> source $file
274 210016 ---> eval (~/.local/bin/cw init fish post --rcfile 99_fig_post | string split0)
39 210071 --> source $file
177 401973 -> for file in $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish $__fish_vendor_confdirs/*.fish...
704 404789 > builtin source /opt/homebrew/Cellar/fish/3.7.1/share/fish/config.fish |
Beta Was this translation helpful? Give feedback.
-
Version 0.14.1 does not have this issue. Starting from 0.15.0, this issue appears. |
Beta Was this translation helpful? Give feedback.
-
I have identified the issue here, we will release a fix early this week. |
Beta Was this translation helpful? Give feedback.
-
This issue has been fixed and is public in version |
Beta Was this translation helpful? Give feedback.
This issue has been fixed and is public in version
0.15.2
. You can runcw update
to get the latest version.