the nfa engine seems to be badly suited for keyword type patterns, see also:
https://groups.google.com/forum/#!topic/vim_dev/cPcMap1BdQw


On Fri, Oct 11, 2013 at 4:26 PM, David Fishburn <[email protected]>wrote:

>
> NFA engine takes almost three times (300 vs 107 seconds) as long to
> complete my plugin task.
>
> :ver
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 11 2013 09:03:38)
> MS-Windows 32-bit GUI version with OLE support
> Included patches: 1-52
>
> My SQLUtilities plugin reformats SQL statements, through the use of many
> regular expressions using:
> :s///
> substitute()
> synID()
> syncIDtrans()
> search()
>
> I thought I would use :syntime to help identify what expressions were
> causing issues, but the results do not help me much.  I am also not certain
> if perhaps I an running things correctly to help identify where the issue
> might be.
>
> Basically, I do the following:
> :set re=x
> :syntime on
> my plugin call
> :syntime report
> paste to this email.
>
> :set re=x
> :syntime clear
> my plugin call
> :syntime report
> paste to this email.
>
>
> Here are the results:
>
> :set re=0
>
> With :syntime off, this takes 3 minute and 20 seconds.
>
>   TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME
> PATTERN
>   0.148406   2095   60      0.001223    0.000071  sqlNumber
>  -\=\<\d*\.\=[0-9_]\>
>   0.014026   2035   0       0.000142    0.000007  sqlDashComment     --
>   0.013963   2035   0       0.000078    0.000007  sqlMultiComment    /\*
>   0.013940   2095   60      0.000152    0.000007  sqlString          '
>   0.013811   2035   0       0.000200    0.000007  sqlSlashComment    \/\/
>   0.002153   16919  16253   0.000002    0.000000  sqlString          "
>   0.001525   7521   7521    0.000008    0.000000  sqlString          "
>   0.000007   36     36      0.000000    0.000000  sqlString          '
>
>   0.207830   34771
>
>
> :set re=1
>
> With :syntime off, this takes 1 minute and 47 seconds.
>
>   TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME
> PATTERN
>   0.295036   4295   120     0.001223    0.000069  sqlNumber
>  -\=\<\d*\.\=[0-9_]\>
>   0.065744   4965   795     0.001454    0.000013  sqlString          '
>   0.028317   4175   0       0.000233    0.000007  sqlDashComment     --
>   0.028185   4175   0       0.000199    0.000007  sqlMultiComment    /\*
>   0.027620   4175   0       0.000200    0.000007  sqlSlashComment    \/\/
>   0.004863   34883  33451   0.000263    0.000000  sqlString          "
>   0.003288   15763  15763   0.000012    0.000000  sqlString          "
>   0.000011   72     72      0.000000    0.000000  sqlString          '
>
>   0.453065   72503
>
>
> I don't even see many of the regexp expressions I used.  Given I am
> formatting SQL statements, I am searching for many SQL keywords, (SELECT,
> INSERT, UPDATE, DELETE, ...) and I don't see those words even referenced in
> the syntime report output.
>
> Thanks for any input.
>
> David
>
>  --
> --
> 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.

Raspunde prin e-mail lui