-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fish startup time increases significantly with this plugin #23
Comments
It would be great if you can share your profile measurements as well as your OS and software used (OS, Fish, Fisher and Gitnow versions). Otherwise I can not verify it. FYI, take in mind that the function This download only happens once for example at installation. So it should not be relatated to your issue. gitnow/functions/__gitnow_config_file.fish Lines 13 to 16 in 835035f
I use this as a workaround because Fisher has no install event (for install this file once) that's why I need to bother users with this checking and downloading. However I have addresed this on a separeted project https://github.com/joseluisq/paket. |
Sorry, I wanted to add specs but didn't know exactly which ones you want. |
After a quick review here few "expensive" calls. # 0.1 This is not related to Gitnow
## Your profile
256 256 --> [ -f $file -a -r $file ]
1365 3544722 --> source $file
145 145 ---> set -q XDG_CONFIG_HOME
106 106 ---> set XDG_CONFIG_HOME ~/.config
# 0.2 This is not related to Gitnow
## My profile
54 54 --> [ -f $file -a -r $file ]
293 402596 --> source $file
26 26 ---> set -q XDG_CONFIG_HOME
39 39 ---> set XDG_CONFIG_HOME ~/.config
# 1.1 Your profile
805 144823 ---> source "$fish_completions/__gitnow_completions.fish"
50159 143660 ----> source $__fish_data_dir/completions/git.fish
# 1.2 My profile
292 34214 ---> source "$fish_completions/__gitnow_completions.fish"
14271 33767 ----> source $__fish_data_dir/completions/git.fish
# 2.1 Your profile
4953 3372829 -----> for line in (command cat $config_file)
# comments: skip out comment lines
if __gitnow_is_comment_line $line
continue
end
# 2.2 My profile
475 361382 -----> for line in (command cat $config_file)
# comments: skip out comment lines
if __gitnow_is_comment_line $line
continue
end
# 3.1 Your profile
120 120 -------> test has_keybindings
291 70882 -------> __gitnow_read_keybinding_line $line
1122 30610 --------> set -l pairs (echo -n $line | command sed 's/^ *//;s/ *$//')
29488 29488 ---------> echo -n $line | command sed 's/^ *//;s/ *$//'
124 39981 --------> if not __gitnow_is_key_value_pair $pairs
return
# 3.2 My profile
15 15 -------> test has_keybindings
42 15871 -------> __gitnow_read_keybinding_line $line
241 2645 --------> set -l pairs (echo -n $line | command sed 's/^ *//;s/ *$//')
2404 2404 ---------> echo -n $line | command sed 's/^ *//;s/ *$//'
8 4224 --------> if not __gitnow_is_key_value_pair $pairs
return In general looks like parsing the So for now this is not Gitnow related issue essentially compared with a Linux desktop where Gitnow/Fish runs faster. |
Here's the profile from my desktop computer.
|
Here the test on my ArchLinux workstation: ~> fish -v
fish, version 3.1.2
~> fisher -v
fisher version 3.2.11 ~/.config/fish/functions/fisher.fish
~> gitnow -v
GitNow version 2.5.0
~> time fish -c ''
________________________________________________________
Executed in 450,00 millis fish external
usr time 392,93 millis 801,00 micros 392,13 millis
sys time 75,24 millis 231,00 micros 75,01 millis Last command has run in approx. 450ms. Wierd that for you test takes more time. |
Here the slow executions of your profile. # 1. Git completions (long file) by Fish utils is sourced by Gitnow on `__gitnow_completions.fish` file
418 98999 ---> source "$fish_completions/__gitnow_completions.fish"
31708 98084 ----> source $__fish_data_dir/completions/git.fish
# 2. Calling to __gitnow_read_config function is slow, this file parses the .gitnow file.
80 1685682 ---> __gitnow_read_config
167 3554 ----> set gitnow_xpaste (__gitnow_get_clip_program)
49 Improvements: I need to measure profiles, refactor the |
Tests Just to confirm that above can you try:
Could you also share you computer specs CPU,RAM? Because I guess I can not see this slowness due my specs are different than yours. |
You probably just have a faster machine. But 400 ms for a single plugin is still a lot, seeing that the rest of the shell (including other plugins) took less than 100 ms on my slower machine. It's a few years old Lenovo G50-45 laptop. 8 GB RAM, 4-core AMD QC 4000 1.3 GHz. |
Yes, my specs are more high that's why I can not see the slowness. Intel Core i7 2.5GHz 8 GB RAM |
It would be great if you can test this by yourself, I'm trying to speed up more that parts of the plugin. |
Sorry, I didn't see the tests previously. The first one made a drastic improvement, bringing it down to 300 ms. And with the second one, it's almost equal to the time without the plugin. |
Great, as I have supposed so. The parsing is very slow and the second one is the large git completions support for Fish (utils) which is used by Gitnow (just two functions of it). |
With 40454f9 I have gained some speed at startup (half faster). Before: ~> time fish -c ''
________________________________________________________
Executed in 441,87 millis fish external
usr time 376,85 millis 0,00 micros 376,85 millis
sys time 83,83 millis 1001,00 micros 82,82 millis After: ~> time fish -c ''
________________________________________________________
Executed in 232,03 millis fish external
usr time 187,56 millis 709,00 micros 186,85 millis
sys time 62,72 millis 163,00 micros 62,55 millis Feel free to test it installing Gitnow from branch |
Few days ago I did rewrite the |
Great, it seems to be good now :) |
After I installed this plugin (using Fisher), the startup time of Fish has increased from about 1 second to about 7 seconds. I confirmed with
fish -p profile.txt
that the slowdown is indeed caused by Gitnow.The text was updated successfully, but these errors were encountered: