ritchie-cli icon indicating copy to clipboard operation
ritchie-cli copied to clipboard

Autocomplete taking a long time to start terminal

Open gontijolucas opened this issue 3 years ago • 0 comments

What happened: when ritchie autocomplete is present on my .zshrc file, my 'bash' session takes around 30 seconds to be ready to use.

What you expected to happen: That there is no delay as big as this at the beginning of my Bash session.

How to reproduce it (as minimally and precisely as possible): ritchie autocomplete needs to be in start script. ~/.zshrc

[[ -r /usr/local/bin/rit ]] && rit completion zsh > ~/.rit_completion
source ~/.rit_completion

Anything else we need to know?:

I have benchmarked my bash to find the source of problem, and It seems that the problem occurred in the rit conclusion zsh.

With ritchie autocomplete, start in almost 30 seconds.

~ hyperfine --shell zsh 'source ~/.zshrc'
Benchmark 1: source ~/.zshrc
  Time (mean ± σ):     24.987 s ± 11.152 s    [User: 0.200 s, System: 0.039 s]
  Range (min … max):    0.454 s … 30.219 s    10 runs

Testing ritchie autocomplete command in my .zshrc

~ hyperfine 'rit completion zsh > ~/.rit_completion'
Benchmark 1: rit completion zsh > ~/.rit_completion
  Time (mean ± σ):     24.987 s ± 11.152 s    [User: 0.200 s, System: 0.039 s]
  Range (min … max):    0.454 s … 30.219 s    10 runs

Without ritchie autocomplete, start in 205ms.

~ hyperfine --shell zsh 'source ~/.zshrc'
Benchmark 1: source ~/.zshrc
  Time (mean ± σ):     199.7 ms ±   2.0 ms    [User: 180.8 ms, System: 31.5 ms]
  Range (min … max):   197.6 ms … 205.4 ms    14 runs

Environment:

  • Ritchie version (use rit --version): 2.11.3
  • Operating System: Linux (Ubuntu 22.04 LTS)
  • Network plugin / Tool and version (if this is a network-related / tool bug):
  • Others:

gontijolucas avatar Jun 15 '22 17:06 gontijolucas