Vim takes forever to load after editing a huge file

From miscellus

Massive delay in loading (and closing vim)

After editing a massive (450mb) Apache log file, I discovered that Vim took 2 or 3 seconds to load and almost the same time to close down again. I seem to recall dimly, having this problem before but couldn't remember the cause.

Running top & ps-ef showed there was nothing untoward with the system. I then wondered about Vim's history buffer which is stored in the /username/.viminfo config file. Running vim -i NONE starts vim without loading the /username/.viminfo config file. Wow, instant load and close.

Ok, so I had a problem with /username/.viminfo, which in this instance was /root/.viminfo; 470 mb in size. That'll be it then!

I renamed /root/.viminfo to /root/.viminfo.0 so I could get it back in needed and ran vim - it loads and closes instantly (and creates a fresh .viminfo file).

If there are commands you need from the old viminfo you can copy them to the new .viminfo file.

As I am a terrible tinkerer it is quite possible that I had altered a default setting to enable vim to save a huge history file as I doubt that is a default setting.

Anyway, hope this might help someone!