On Fri, Jun 7, 2013 at 4:12 PM, Bram Moolenaar <[email protected]> wrote:
>>
>> TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
>> 3.234792 47684 0 0.002802 0.000068 xmlSyncDT
>> \_.\(<!DOCTYPE\)\@=
>
> The XML syntax has some very expensive patterns. And this one is
> terrible. \_. matching anything, including line breaks, so it does a
> recursive match for <!DOCTYPE everywhere...
>

I don't know how noticeable the improvement will be to the user, but
removing the "match anything" atom in the sync group improves it a lot. See
attached patch. Note that for this sync group to be used, you need to leave
syntax folding off.

Before:

TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
0.615997 11846 0 0.000867 0.000052 xmlSyncDT \_.\(<!DOCTYPE\)\@=
0.358014 50211 22671 0.000095 0.000007 xmlRegion </\z1\_\s\{-}>
0.264438 35045 26123 0.000080 0.000008 xmlRegion <\z([^ /!?<>"']\+\)

After:

TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
0.314540 50205 22671 0.000081 0.000006 xmlRegion </\z1\_\s\{-}>
0.236283 35042 26123 0.000057 0.000007 xmlRegion <\z([^ /!?<>"']\+\)
0.229934 31852 28736 0.000072 0.000007 xmlEndTag </[^ /!?<>"']\+>
0.210974 34785 25866 0.000060 0.000006 xmlTag <[^ /!?<>"']\@=
0.137369 22671 3 0.000062 0.000006 xmlRegion <!--\_.\{-}-->
0.115387 26165 26165 0.000052 0.000004 xmlTag >
0.092463 12992 9930 0.000093 0.000007 xmlError [<&]
0.090760 11846 0 0.000851 0.000008 xmlSyncDT \ze<!DOCTYPE

I generated with TOhtml using both syntax files, and the result is the same, so
I don't THINK this change will cause any problems.

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


Attachment: xml.vim.patch
Description: Binary data

Raspunde prin e-mail lui