skwp / dotfiles

YADR - The best vim,git,zsh plugins and the cleanest vimrc you've ever seen
http://skwp.github.com/dotfiles
BSD 2-Clause "Simplified" License
6.96k stars 1.41k forks source link

YADR is slow. #661

Closed domi91c closed 7 years ago

domi91c commented 9 years ago

I love this repo, but I've had lots of problems with speed. I've tried on a 3.4ghz iMac and a 2.4ghz 2011 Macbook Pro, and both are sluggish when running commands like irb and rails c. Even with cd, I get a quarter to half second delay. Vim takes about two seconds to start. Is this a sacrifice for the large amount of plugins, or am I getting unusually low performance?

I've also noticed that when text has filled the terminal so that the scrollbar must be used, delays becomes longer.

And again, when I'm using plain zsh or bash I get instant output on most commands. I'm not sure what other information to give at this point so just let me know what you need.

domi91c commented 9 years ago

I've also tried Prezto on it's own and it runs great, so I can rule that out as well.

fayimora commented 9 years ago

I remember having these problems 2/3 years ago. The number of plugins certainly slows down vim but this issue disappeared when I switched to an SSD.

Probably not the fix you were looking for but doesn't hurt to know :smiley:

ryansch commented 9 years ago

I've had this problem on and off over the past few years depending on the changes. At the moment I'm struggling with it again. I'll try and figure out how to speed things up and report back.

Edit: I have an SSD :wink:

ryansch commented 9 years ago

@portOdin Try this branch: https://github.com/ryansch/yadr/tree/ryansch-fast

It's an old branch without about a years worth of changes. It seems much faster to me. If you agree we can bisect from there.

fullofcaffeine commented 9 years ago

True that, specially after upgrading to El Capitan, vim became quite slow, haven't had the time to debug it, though.

On Sat, Oct 10, 2015 at 9:19 AM, Ryan Schlesinger notifications@github.com wrote:

@portOdin https://github.com/portOdin Try this branch: https://github.com/ryansch/yadr/tree/ryansch-fast

It's an old branch without about a years worth of changes. It seems much faster to me. If you agree we can bisect from there.

— Reply to this email directly or view it on GitHub https://github.com/skwp/dotfiles/issues/661#issuecomment-147093496.

ryansch commented 8 years ago

I tried out neovim with latest yadr over the weekend. I've changed a few of the plugins but other than that it's working beautifully. I'll post instructions soon.

fullofcaffeine commented 8 years ago

Ryan, please do!

On Tue, Oct 13, 2015 at 10:26 AM, Ryan Schlesinger <notifications@github.com

wrote:

I tried out neovim with latest yadr over the weekend. I've changed a few of the plugins but other than that it's working beautifully. I'll post instructions soon.

— Reply to this email directly or view it on GitHub https://github.com/skwp/dotfiles/issues/661#issuecomment-147749891.

ryansch commented 8 years ago

I'm going to continue the shakedown cruise before I do. No blockers yet but some workarounds required.

charlimmelman commented 8 years ago

On fresh install of El Capitan. Running new MBP with SSD. I'm experiencing a slight lag while in input mode, especially when vim is suggesting autocompletions.

nkgm commented 8 years ago

@charlimmelman with iTerm2 in full screen, vim running with no splits, do you see any lag when scrolling down a large (few hundred lines) file on high key repeat rate? (~20ms) Is scrolling affected when the NERDTree panel is open?

charlimmelman commented 8 years ago

@nkgm I installed Karabiner. I set the repeat rate to 20ms. Restarted to ensure. Opened a large ruby file (1480 lines) in Vim / iTerm2. Set to full-screen. Scrolling seems to be nice and smooth. I then opened NERDTree, and it definitely seemed to slow it down a bit, but still useable.

nkgm commented 8 years ago

Thanks @charlimmelman. I'm on fresh El Capitan on a 2011 quad I7 MBP. iTerm appears to be consuming twice the CPU (~70%) when scrolling with NERDTree panel visible. Still the lowest CPU I can get on scrolling is ~35%.

charlimmelman commented 8 years ago

@nkgm My major issue is when in insert mode and holding the left arrow down. That can be super slow. But I think it has to do with the amount of files in my buffer. Also, stuff like using ",mc" then crtl+n and then pressing "c" to change more than one instance can literally cause my whole machine to go into seizure :-)

fullofcaffeine commented 8 years ago

This has been a major blockage for me lately. I completely stopped using yadr/tmux + vim after updating to El Capitan, and switched to Sublime Text 3. I much prefer working from tmux, but the slowness is unbearable, and sometimes, when opening big files, it reaches a point where it's unusable. Sublime is the fastest editor I've ever used and excels at opening big files.

I even thought about completely wiping out El Capitan and switching to Ubuntu on my macbook pro, but while I like Ubuntu, my workstation has been OSX-based for many years, so switching now would take quite a bit of time until I find replacements for all the OSX software I use.

If anyone has any suggestions on how to get yadr/tmux/vim to a usable state (meaning fast as it should be), please share. For now, I've put htem under suspendend animation, as much as I'd like to keep using them.

Obs: I use iterm2.

dboshardy commented 8 years ago

@ryansch do you have anything on using neovim? I'm also experiencing slowness in vim and was looking into replacing it with neovim.

ryansch commented 8 years ago

I’ve been using it as my daily driver since Oct 2015. Honestly I just need to clean up my yadr/neovim adapter and push it somewhere.

dboshardy commented 8 years ago

Is it as simple as symlinking .nvim* to ~/.yadr/vim*, or have you done other tweaks as well?

skwp commented 8 years ago

sorry just catching up on here. I've noticed recent slugishness as well. My guess is that it's a combination of various plugins. I haven't tried neovim yet

ryansch commented 8 years ago

I've created a gist with my current neovim settings (with yadr installed).

https://gist.github.com/ryansch/e9a8b19dce1926e32ae63ba324e84e79

I've disabled plugins I have no need of and replaced a few with neovim specific ones (fzf instead of ctrlp).

domi91c commented 8 years ago

I'm currently just using Prezto, but I've noticed fasd makes ls sluggish. It sucks, because fasd is a massive time saver. Can anyone recommend an alternative?

kathgironpe commented 7 years ago

Any plan to use neovim?

nkgm commented 7 years ago

As far as vim redraws go (equally affects neovim), you might want to check https://github.com/skwp/dotfiles/issues/670#issuecomment-282773995

@katgironpe I've been using neovim for a while now and so far I've observed no discernible speed difference.

padi commented 7 years ago

@katgironpe yay for neovim!

As @nkgm said, there's no noticeable speed difference in neovim, perhaps only a few neat features here and there, but roughly the same bottlenecks when I started profiling slow processes. On my end, it's often that the culprit is a ruby-related plugin (e.g. tpope/vim-bundler, vim-ruby/vim-ruby, etc.).

For now, I keep 2 rc files: one for YADR + vim & macvim, and another slimmer custom ~/.config/init.vim for neovim, adding stuff from YADR as I see fit.

https://padi.github.io/articles/profiling_vim/

kathgironpe commented 7 years ago

@padi I kind of like Neovim for Ubuntu. Then I am slowly switching to Spacemacs. What I found is I am maintaining my own dotfiles for Ubuntu, which I should not be doing. It's not much effort. There are no significant differences, indeed. I still use this repo for Mac OS X. And sadly, I have to use Atom Editor too. Don't ask me why.

lfilho commented 7 years ago

In my fork I'm also using NeoVim, and I also removed many of the ruby plugins, as I'm not a ruby dev and didn't want to clutter my vim config with so many plugins I wouldn't use. And I have not experienced any speed issues.

I encourage everyone in this thread to profile their vim usages in order to help find the (possible) issue and hence help move this thread move forward.

That being said, the biggest speed advantage for me was moving from Ag to RipGrep. The speed was noticeable. Ctrlp was fast even on a friend's non-SSD machine. I think we are almost there. See the PR I just mentioned above... Help is welcome!

skwp commented 7 years ago

Does anyone have a guide to moving yadr to neovim? It doesn't read vimrc by default?

ryansch commented 7 years ago

@skwp https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc

lfilho commented 7 years ago

@skwp one of the things we'd need to do is update the nvim config path. I also had to change the vundle initialization path, as neovim uses the XDG Base Directory Specification for application configuration and data file locations.

Some other issues we'd have to solve before moving to NeoVim:

Personally I'm trying to move to the terminal...

lfilho commented 7 years ago

As for a guide of moving Yard to NeoVim... I did it in my fork. But since I decided to stay in the terminal that also meant changing some keymaps to not depend on Cmd key (also thinking about Linux support...).

Also changed some plugins like NeoComplete (to Deoplete), Vundle (to Plug) and many others. After we agree on whether/how to tackle the above points, I could elaborate in more details, maybe a blog post... And then we could cherry pick some commits or create some PRs, one by one...

lfilho commented 7 years ago

Also, just so we don't loose sight of the real problem of this thread (YADR being slow), NeoVim won't make things much faster. It's more likely that a (set of) plugin(s) are causing the sluggishness so in order to speed those up (while moving to NeoVim) we would also have to change those plugins for plugins that actually use the advanced features of NeoVim, otherwise I think we might just be inserting another variable in the equation...

In fewer words, we should have other reasons to move to NeoVim instead of just the promise of being (immediately) faster.

IMHO RipGrep and profiling some ruby/rails plugins as suggested above could be promising than the mere switch to NeoVim.

skwp commented 7 years ago

I want to close this issue as it's not really a solvable issue but many things interacting together. We can make efforts to make things faster but we need individual issues opened for specific plugins making things "slow" with specific examples.