simnalamburt / vim-mundo

:christmas_tree: Vim undo tree visualizer
https://simnalamburt.github.io/vim-mundo
GNU General Public License v2.0
792 stars 28 forks source link

Very very slow #91

Closed eyalk5 closed 4 years ago

eyalk5 commented 4 years ago

Hi, I am on latest version of mundo , neovim 0.5 .

When I tried to open it, it hanged for more than 10 minutes, and it still hasn't opened. I believe eventually, it would be opened as I remember delays of 5 minutes. The file is text file 43 kb.

I did made a lot of changes along the time. I do have some "memory pressure" in my OS, as appeared in activity monitor (like close to 16gb of ram usage, probably need to go to page file ). But other things work pretty well.

So, it is not justified. Can something be optimizied out?

resolritter commented 4 years ago

According to my findings so far, the main culprit is not the amount of nodes, nor the rendering code for formatting the graph's output, but the fact that diffs are computed upfront - this shouldn't be needed if g:mundo_inline_undo is false, but even when it's true, inline diffs should optimally only be computed for the currently visible nodes. I've left a comment with more details and a suggestion there:

https://github.com/simnalamburt/vim-mundo/issues/14#issuecomment-660565181

If that comment doesn't pick up activity then I'm planning to file a new issue. @simnalamburt you mention in the further plans that making this plugin faster is a goal, so I'd appreciate if you could opinion on the ideas I posted in that comment.

simnalamburt commented 4 years ago

Thanks for the report @eyalk5, @resolritter! Looks like vim-mundo is performing unnecessary calculation during startup. I don't have enough time to fix this issue for right now, but I'll try to make some spare time within this month. 😢

Looks like this issue is duplicate of #14, I'll close this issue and continue the conversation overthere to consolidate information into one.