onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.35k stars 300 forks source link

Oni is very slow #2728

Open danielo515 opened 5 years ago

danielo515 commented 5 years ago

Oni Version: 0.3.9 Neovim Version (Linux only): Operating System: OSX

Issue: Oni is very slow

Not sure what is the problem from the very beginning Oni has felt slow, very slow. My machine is a macbook pro with an i9 and 32GB of ram, so I don't think it is a power problem. This problem is particularly noticeable when navigating files (as reported on another issue) but in general every operation in oni is slow: deleting lines, moving the cursor, changing words... all the tasks related to edition. It is curious that the rest of the tasks does not feel as slow, for example the sneak mode is snappy and responsive, opening a file feels fast... is just that trying to edit any kind of file (json, js, ts) feels very slow.

This editor is very attractive, but with this level of slowness it quite unusable. Regards

oni-bot[bot] commented 5 years ago

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

tom-james-watson commented 5 years ago

The team have started working on a Oni 2, which is a rewrite as a native client.

danielo515 commented 5 years ago

Oh yes, and I tried it @tom-james-watson But after installing all deps, compiling and all that stuff all what I get is a plain text input, nothing else. So my impression is that it is very far from being usable, and of course ever farther from being a replacement to current Oni. On the other hand, I have some other electron based editors (vscode, atom) and none of them is as slow as Oni is right now.

Regards

eyalk5 commented 5 years ago

I wish to say that specifically doing vimgrep is really slow. Doing verbose=15 I noticed that there is this line , written once:

Executing BufReadPost Auto commands for "*" autocommand :call OniNotifyWithBuffers("BufRead")

That function gets called for every file, and it seems to be slow

line 1: return bufexists(a:i) && buflisted(a:i) && "quickfix" !=? getbufvar(a:i, "&buftype") function OniNotifyWithBuffers[3]..OniGetAllBuffers[2]..User_buffers[1]..<SNR>84_filter_buffer returning #0 Indeed , it was around 5X-7X slower than the same search in neovim.

eyalk5 commented 5 years ago

Mitigation for vimgrep :


function! Matches2(a)
    :set eventignore=all
         execute ":vimgrep " . '/'.a:a . "/j **/*"  
    :set eventignore=
        :copen
endfunction```
josemiguelo commented 5 years ago

Another thing that really helped me out, was adding "ui.animations.enabled": false, to the config file. It really makes a difference. Also, check if you have a big workspace with nested folders with lots of files (like node_modules). I also added this to the config file: "oni.exclude": ["**/node_modules/**", ".git", "**/build/**"],