alias-tips icon indicating copy to clipboard operation
alias-tips copied to clipboard

Performance Hit on Oh My Zsh

Open aksh1618 opened this issue 6 years ago • 2 comments

I love Alias tips, but it causes my startup time to take a severe hit, as shown by zprof:

~> zprof
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)    1         242.86   242.86   43.35%    242.86   242.86   43.35%  _alias_tips__preexec

Is there any way to fix/optimize this? I am using oh-my-zsh.

aksh1618 avatar Dec 17 '18 10:12 aksh1618

I think the performance problems stem from the Python code that is being run; I believe the actual Zsh code is quite minimal and fast. It also depends linearly on the amount aliases and functions one has, but the Python runtime start up should be the dominant factor. If we would port the code from Python to Go/Rust/C we could ship OS dependant binaries and get a better startup latency.

djui avatar Dec 17 '18 10:12 djui

You may look at https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/alias-finder witch is about 10 times faster (written in pure ZSH).

yld avatar Dec 30 '19 16:12 yld