Ben Fritz wrote:

> Trying on Windows 7 64-bit with 64-bit HUGE Vim 7.4.522 shows it
> taking a REALLY long time just to match "1234567890" (one line in the
> buffer) with pattern ".\{1,8000}".
> 
> Furthermore, I can't seem to interrupt the search with <C-C>, and I
> get a "search hit BOTTOM, continuing at TOP" message before it finally
> matches.
> 
> Anchoring the match by changing the pattern to ".\{1,8000}0" or
> ".\{1,8000}$" does not seem to help. Even anchoring at both ends,
> "^.\{1,8000}$", doesn't help very noticeably.
> 
> Setting re=1 makes the search pretty much instantaneous.
> 
> Omitting the "8000" makes the search just as fast with re=2. I.e. this
> pattern is fast: ".\{1,}"

Yeah, if you leave out the limit then the states are all the same.  With
the limit the state differs depending on where the match starts.

It's going to be difficult to find an efficient way to implement this
with NFA.  We might need to detect this part of the RE and fall back to
the old engine.  I would actually think that the limit that Christian
added would work for this as well, could be useful to figure out why it
doesn't run into the limit on number of states.  Perhaps because the
number of states is not going above the upper limit, but it's slow
because every state changes at every character.

-- 
hundred-and-one symptoms of being an internet addict:
111. You and your friends get together regularly on IRC, even though
     all of you live in the same city.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui