On 7/28/06, Max Dyckhoff <[EMAIL PROTECTED]> wrote:
I have placed all the identifiers on a single line with "syn keyword
(type)" at the beginning. There are two files of keywords (types and
defines/enumerators), which are 250,000 characters and 650,000
characters respectively ...

The way that I am making use of these files is by sourcing them in
after\syntax\c.vim, which means they are loaded every time I open a
file. This becomes mildly annoying, because the load of the file now
takes 2-3 seconds, thanks to the two massive "syn keyword" lines.

I made some experiements and found that if, instead of
making one 650-kb long commandline (which indeed
takes ~ 2 sec to process) ... if you put, say, 10 keywords
per 'syn keyword' line, then vim sources such 1MB file in:
         .... fanfares ....
         under 0.1 sec.
Amazing feat on vim's part.

(That's my test of 100,000 keywords in 10,000 lines at
10 keywords per each). Note that even though file becomes
longer  ('syn keyword' parts gets repeated),
the sourcing time drops sharply.

Apparently what slowed down vim in the 650-kb-command-line-lengthcase was the
length of one commandline itself. Can it be some
kind of record of commandline length ?

Regarding your request to source your after/syntax/c.vim
only once. This is difficult. Syntax is reset and sourced
again for each opened file. But maybe you reconsider
when you remake the c.vim.

Yakov

Reply via email to