roxma / vim-tmux-clipboard

seamless integration for vim and tmux's clipboard
MIT License
290 stars 24 forks source link

Extreme slowdown when doing global delete. #7

Open ilAYAli opened 6 years ago

ilAYAli commented 6 years ago

~100x slowdown in file containing 50k lines of text:

without plugin:

time vim -c ':g/PatternToDelete/d' +qa! ~/tmp/largefile.txt

real    0m0.365s
user    0m0.259s
sys     0m0.097s`

with plugin:

time vim -c ':g/PatternToDelete/d' +qa! ~/tmp/largefile.txt

real    0m27.342s
user    0m7.580s
sys     0m19.247s
imjaroiswebdev commented 1 year ago

I don't know if it's still relevant, but a workaround to this issue is to send the deletions to the underscore (_) register, like for example...

time vim -c ':g/PatternToDelete/d _' +qa! ~/tmp/largefile.txt

In fact, it is how is recommended on Vim docs.