On Jul 9, 2013 4:58 PM, "Bram Moolenaar" <[email protected]> wrote: > > > Grüner_Gimpel wrote: > > > I noticed that using Vim 7.4a the Vimwiki plugin works measurably > > slower with re=0 than with re=1. I figured out the reason is this > > regexp in the syntax definition: > > > > [[:alnum:]]\@<!\%(\%(\%(http\|https\|file\|ftp\|gopher\|telnet\|nntp\|ldap\|rsync\|imap\|pop\|irc\|ircs\|cvs\|svn\|svn+ssh\|git\|ssh\|fish\|sftp\):\%(\/\/\)\)\|\%(mailto\|news\|xmpp\|sip\|sips\|doi\|urn\|tel\):\)\S\{-1,}\%(([^ \t()]*)\)\=\S* > > > > You may know what it is supposed to match. > > Removing some of the branches makes it faster and so does removing > > [[:alnum:]]\@<! > > > > I don't know if there is a standard method for measuring speed of the > > syntax highlight, but here is what I have done: > > - open a relatively large file > > - :set syn=off > > - :syntax match Number /[[:alnum:]]\@<!\%(\%(\%(http\|https\|file\|ftp\|gopher\|telnet\|nntp\|ldap\|rsync\|imap\|pop\|irc\|ircs\|cvs\|svn\|svn+ssh\|git\|ssh\|fish\|sftp\):\%(\/\/\)\)\|\%(mailto\|news\|xmpp\|sip\|sips\|doi\|urn\|tel\):\)\S\{-1,}\%(([^ \t()]*)\)\=\S*/ > > - scroll with <c-e> and <c-y> > > - extremely slow with re=0 but normal slow (*wink*) with re=1 > > > > So, can this behavior be considered as a bug? > > The main problem is the [[:alnum:]]\@<! item. Have you tried adding a > limit? Should be [[:alnum:]]\@1<! > > Or perhaps using \< instead will work. > > For measuring times: use :syntime.
Could not it deduce a limit by itself in such simple cases? > -- > No children may attend school with their breath smelling of "wild onions." > [real standing law in West Virginia, United States of America] > > /// 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/groups/opt_out. > > -- -- 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/groups/opt_out.
