Out of the blue, my vim startup time jumped to about 5 s, and I traced
the cause to yankring.  Eventually I found that I had a large yankring
history file; however, yankring limits its yanks to 1 MB and the
history file was only 1 MB in size.  My vim reads a 1 MB file in tens
of ms, so I investigated why yankring slowed so much.

Yankring writes each yanked item as one line, and if there are
multiple lines within an item they are separated with ^b, hex 02,
characters.  So my yankring history file had a very long line, 1 MB
long, and when the plugin read the file with readfile(), it took a lot
longer than 10 ms, as revealed by

:let t = reltime()|let f = readfile('yankring_history_v2.txt')|echo
reltime(t)

it shows [2, 681477] which I take to mean 2.68 s.

Why is readfile() so slow when the file has a long, MB, line?  (The
binary flag does not affect the speed.)

Regards, John

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui