Bram Moolenaar <[email protected]> wrote:

> drdr wrote:
>
>> *Reproduce:*
>>
>> 1)create an file with following contents
>> util.clientflow_handle_unacceptable_http_status( self.exceptions, key,
>> status, req, resp )
>>
>>        ^---cursor stays here( after the 'e')
>>
>> 2) run following command( with two "\w" ):
>> :echo searchpos('\V\%(*\w\|\w*\)\+\%#', "bn" )
>>
>> hangs VIM. <C-c> can break the silence and VIM complains: "Interrupted"
>>
>> But the following command with only one "\w" works fine:
>> :echo searchpos('\V\%(*\w*\)\+\%#', "bn" )
>
> I can't reproduce it.


I can reproduce it with Vim-7.2.315 on Linux x86 (huge, -O0 -g).

There is no star * in the regex.  The original message was
formatted in HTML (bad idea in vim_dev) which probably
messed up the way it looked in text email clients.

It does not hang. It just takes a very long time on long lines
during which Vim takes 100% of CPU.

This is the time it takes on my core2 laptop with lines of
24, 25, 26, 27 characters:

$ time vim -u NONE -c ':norm 24ix' -c ':norm 0' -c  ":echo
searchpos('\V\%(\w\|\w\)\+\%#', 'bn')" -c 'q!'

real    0m29.709s
user    0m29.458s
sys     0m0.240s

$ time vim -u NONE -c ':norm 25ix' -c ':norm 0' -c  ":echo
searchpos('\V\%(\w\|\w\)\+\%#', 'bn')" -c 'q!'

real    0m59.093s
user    0m58.752s
sys     0m0.288s

$ time vim -u NONE -c ':norm 26ix' -c ':norm 0' -c  ":echo
searchpos('\V\%(\w\|\w\)\+\%#', 'bn')" -c 'q!'

real    1m58.732s
user    1m57.679s
sys     0m0.948s

$ time vim -u NONE -c ':norm 27ix' -c ':norm 0' -c  ":echo
searchpos('\V\%(\w\|\w\)\+\%#', 'bn')" -c 'q!'

real    3m56.264s
user    3m54.867s
sys     0m1.216s

You get the point: amount of time doubles every time
you add just one character to the line.

Cheers
-- Dominique

-- 
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui