Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Syntax/Performance] Perl6 syntax significantly slows down vim #4339

Closed
cdluminate opened this issue May 5, 2019 · 13 comments
Closed

[Syntax/Performance] Perl6 syntax significantly slows down vim #4339

cdluminate opened this issue May 5, 2019 · 13 comments

Comments

@cdluminate
Copy link

cdluminate commented May 5, 2019

Is your feature request related something that is currently hard to do? Please describe.

It's difficult to gain a smooth editing experience with plugin-less vim on perl6 source files, because the very complex perl6 syntax has already slowed vim down.

Describe the solution you'd like

Open an perl6 source code, the scrolling experience is far not smooth enough like many other simpler languages such as perl5 or python. I request some optimization in vim's syntax highlighting mechanism, or optimization in the perl6 syntax.

Describe alternatives you've considered

Maybe Emacs or VScode has a better rendering engine? I've still not tried them out yet.

@dpelle
Copy link
Member

dpelle commented May 5, 2019

Can you provide your vim version, and a link to a Perl6 source file that shows this performance issue?

@dpelle
Copy link
Member

dpelle commented May 5, 2019

I opened the following file Perl6 file...
https://github.com/perl6/modules.perl6.org/blob/master/lib/ModulesPerl6/DbBuilder.pm
... using:

$ vim --clean DbBuilder.pm -c 'setfiletype perl6' \
   -c 'syntime on' \
   -c redraw -c redraw -c redraw \
   -c 'syntime report'

I'm not sure this reproduces your slow highlighting, but this is what I got;

 TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               1,1           Top
  0.098869   210    64      0.001403    0.000471  p6Routine          \%(\k\|\K\@<=[-']\)\@<!\%(eager\|hyper\|substr\|index\|rindex\|grep\|map\|sort\|join\|lines\|hints\|chmod\|split\|reduce\|min\|max\|reverse\|truncate\|zip\|cat\|roundrobin\|classify\|first\|sum\|keys\|values\|pairs\|defined\|delete\|exists\|elems\|end\|kv\|any\|all\|one\|wrap\|shape\|key\|value\|name\|pop\|push\|shift\|splice\|unshift\|floor\|ceiling\|abs\|exp\|log\|log10\|rand\|sign\|sqrt\|sin\|cos\|tan\|round\|strand\|roots\|cis\|unpolar\|polar\|atan2\|pick\|chop\|p5chop\|chomp\|p5chomp\|lc\|lcfirst\|uc\|ucfirst\|capitalize\|normalize\|pack\|unpack\|quotemeta
  0.072414   146    0       0.003027    0.000496  p6Normal           \%(\<\%(role\|grammar\|slang\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*
  0.071977   146    0       0.003017    0.000493  p6RegexName        \%(\<\%(regex\|rule\|token\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*
  0.052276   146    0       0.002103    0.000358  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<m\s*:P\%(erl\)\?5\s*\)\@<=[]\@!" skip="\\]
  0.038448   150    4       0.000709    0.000256  p6Type             \%(\k\|\K\@<=[-']\)\@<!\%(Object\|Any\|Junction\|Whatever\|Capture\|Match\|Signature\|Proxy\|Matcher\|Package\|Module\|Class\|Grammar\|Scalar\|Array\|Hash\|KeyHash\|KeySet\|KeyBag\|Pair\|List\|Seq\|Range\|Set\|Bag\|Mapping\|Void\|Undef\|Failure\|Exception\|Code\|Block\|Routine\|Sub\|Macro\|Method\|Submethod\|Regex\|Str\|Blob\|Char\|Byte\|Codepoint\|Grapheme\|StrPos\|StrLen\|Version\|Num\|Complex\|num\|complex\|Bit\|bit\|bool\|True\|False\|Increasing\|Decreasing\|Ordered\|Callable\|AnyChar\|Positional\|Associative\|Ordering\|KeyExtractor\|Comparator\|OrderingPai
  0.033205   146    0       0.000619    0.000227  p6HyperOp          \%(<<\)\?!\?\%(div\|%\|mod\|+&\|+<\|+>\|\~&\|?&\|\~<\|\~>\|+|\|+\^\|\~|\|\~\^\|?|\|?\^\|xx\|x\|\~\|&&\|&\|also\|<==\|==>\|<<==\|==>>\|==\|!=\|<\|<=\|>\|>=\|\~\~\|eq\|ne\|lt\|le\|gt\|ge\|=:=\|===\|eqv\|before\|after\|\^\^\|min\|max\|\^ff\|ff\^\|\^ff\^\|\^fff\|fff\^\|\^fff\^\|fff\|ff\|::=\|:=\|\.=\|=>\|,\|:\|p5=>\|Z\|minmax\|\.\.\.\|and\|andthen\|or\|orelse\|xor\|\^\|+=\|-=\|/=\|\*=\|\~=\|//=\|||=\|+\|-\|\*\*\|\*\|//\|/\|\~\|||\||\|but\|does\|<=>\|leg\|cmp\|\.\.\|\.\.\^\^\|\^\.\.\|\^\.\.\^\)<<
  0.029823   146    0       0.000576    0.000204  p6HyperOp          «\?!\?\%(div\|%\|mod\|+&\|+<\|+>\|\~&\|?&\|\~<\|\~>\|+|\|+\^\|\~|\|\~\^\|?|\|?\^\|xx\|x\|\~\|&&\|&\|also\|<==\|==>\|<<==\|==>>\|==\|!=\|<\|<=\|>\|>=\|\~\~\|eq\|ne\|lt\|le\|gt\|ge\|=:=\|===\|eqv\|before\|after\|\^\^\|min\|max\|\^ff\|ff\^\|\^ff\^\|\^fff\|fff\^\|\^fff\^\|fff\|ff\|::=\|:=\|\.=\|=>\|,\|:\|p5=>\|Z\|minmax\|\.\.\.\|and\|andthen\|or\|orelse\|xor\|\^\|+=\|-=\|/=\|\*=\|\~=\|//=\|||=\|+\|-\|\*\*\|\*\|//\|/\|\~\|||\||\|but\|does\|<=>\|leg\|cmp\|\.\.\|\.\.\^\^\|\^\.\.\|\^\.\.\^\)«
  0.029697   157    11      0.000640    0.000189  p6Operator         \%(\k\|\K\@<=[-']\)\@<!\%(div\|x\|xx\|mod\|also\|leg\|cmp\|before\|after\|eq\|ne\|le\|lt\|gt\|ge\|eqv\|ff\|fff\|and\|andthen\|Z\|X\|or\|xor\|orelse\|extra\|m\|mm\|rx\|s\|tr\)\%(\k\|[-']\K\@=\)\@!
  0.018295   146    0       0.000335    0.000125  p6Float            \k\@<!_\@<!\%(\d\|__\@!\)*_\@<!\.\@<!\._\@!\.\@!\a\@!\%(\d\|_\)\+_\@<!\%([eE]_\@!\%(\d\|_\)\+\)\?
  0.012904   146    0       0.000241    0.000088  p6Property         \%(\k\|\K\@<=[-']\)\@<!\%(prec\|irs\|ofs\|ors\|export\|deep\|binary\|unary\|reparsed\|rw\|parsed\|cached\|readonly\|defequiv\|will\|ref\|copy\|inline\|tighter\|looser\|equiv\|assoc\|required\)\%(\k\|[-']\K\@=\)\@!
  0.012361   149    4       0.000227    0.000083  p6FlowControl      \%(\k\|\K\@<=[-']\)\@<!\%(take\|do\|when\|next\|last\|redo\|return\|contend\|maybe\|defer\|default\|exit\|make\|continue\|break\|goto\|leave\|async\|lift\)\%(\k\|[-']\K\@=\)\@!
  0.011947   146    0       0.001157    0.000082  p6BlockLabel       \%(^\s*\)\@<=\h\w*\s*::\@!\_s\@=
  0.011639   146    0       0.000219    0.000080  p6ClosureTrait     \%(\k\|\K\@<=[-']\)\@<!\%(BEGIN\|CHECK\|INIT\|START\|FIRST\|ENTER\|LEAVE\|KEEP\|UNDO\|NEXT\|LAST\|PRE\|POST\|END\|CATCH\|CONTROL\|TEMP\)\%(\k\|[-']\K\@=\)\@!
  0.011363   146    0       0.000910    0.000078  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([\"'`|,$]\)
  0.010320   146    0       0.000189    0.000071  p6PodDelimEndRegion \%(^=end\>\)\@<=
  0.010303   146    0       0.000746    0.000071  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([\"'`|,$]\)\$\@!
  0.010014   146    0       0.000473    0.000069  p6String           \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<tr\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([/\"'`|!,$]\)
  0.009076   149    3       0.000201    0.000061  p6TypeConstraint   \%(\k\|\K\@<=[-']\)\@<!\%(is\|as\|but\|trusts\|of\|returns\|handles\|where\|augment\|supersede\)\%(\k\|[-']\K\@=\)\@!
  0.008357   146    0       0.000479    0.000057  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<m\s*:P\%(erl\)\?5\s*\)\@<=\z([\"'`|,$]\)
  0.007939   156    10      0.000171    0.000051  p6DeclareRoutine   \%(\k\|\K\@<=[-']\)\@<!\%(macro\|sub\|submethod\|method\|multi\|proto\|only\|rule\|token\|regex\|category\)\%(\k\|[-']\K\@=\)\@!
  0.007471   146    0       0.000140    0.000051  p6Attention        \%(\k\|\K\@<=[-']\)\@<!\%(ACHTUNG\|ATTN\|ATTENTION\|FIXME\|NB\|TODO\|TBD\|WTF\|XXX\|NOTE\)\%(\k\|[-']\K\@=\)\@!
  0.007391   147    1       0.000145    0.000050  p6Module           \%(\k\|\K\@<=[-']\)\@<!\%(module\|class\|role\|package\|enum\|grammar\|slang\|subset\)\%(\k\|[-']\K\@=\)\@!
  0.006548   163    17      0.000115    0.000040  p6Number           \k\@<!_\@!\%(\d\|__\@!\)\+_\@<!\%([eE]_\@!+\?\%(\d\|_\)\+\)\?_\@<!
  0.006505   146    0       0.000121    0.000045  p6Float            \k\@<!_\@!\%(\d\|__\@!\)\+_\@<![eE]_\@!-\%(\d\|_\)\+
  0.006463   172    26      0.000111    0.000038  p6VarStorage       \%(\k\|\K\@<=[-']\)\@<!\%(let\|my\|our\|state\|temp\|has\|constant\)\%(\k\|[-']\K\@=\)\@!
  0.006260   190    44      0.000121    0.000033  p6Normal           \%(::\)\@<=\K\%(\k\|[-']\K\@=\)*
  0.006071   151    5       0.000137    0.000040  p6Repeat           \%(\k\|\K\@<=[-']\)\@<!\%(for\|loop\|repeat\|while\|until\|gather\|given\)\%(\k\|[-']\K\@=\)\@!
  0.006003   190    44      0.000098    0.000032  p6Normal           \K\%(\k\|[-']\K\@=\)*\%(::\)\@=
  0.005245   148    2       0.000465    0.000035  p6Routine          \%(\%(\S\k\@<!\|^\)\s*\)\@<=is\>
  0.005040   162    16      0.000093    0.000031  p6Normal           \K\%(\k\|[-']\K\@=\)*(\@=
  0.004772   153    7       0.000104    0.000031  p6Conditional      \%(\k\|\K\@<=[-']\)\@<!\%(if\|else\|elsif\|unless\)\%(\k\|[-']\K\@=\)\@!
  0.004678   153    7       0.000083    0.000031  p6Exception        \%(\k\|\K\@<=[-']\)\@<!\%(die\|fail\|try\|warn\)\%(\k\|[-']\K\@=\)\@!
  0.004423   146    0       0.000084    0.000030  p6Property         \%(is\s\+\)\@<=\%(signature\|context\|also\|shape\)
  0.004383   146    0       0.000088    0.000030  p6Context          \%(\$\|@\|%\|&\|@@\)(\@=
  0.004212   323    177     0.000046    0.000013  p6Variable         \%(@@\|[@&$%]\$*\)\%(::\|\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\)\|\K\)\@=
  0.004003   232    86      0.000103    0.000017  p6StringAuto       \K\%(\k\|[-']\K\@=\)*\ze\s\+=>
  0.003955   150    4       0.000078    0.000026  p6Operator         \%(:\@<!::\@!\|::=\|\.::\)
  0.003949   148    2       0.000254    0.000027  p6StringAuto       \K\%(\k\|[-']\K\@=\)*\ze\%(p5\)\@<!=>
  0.003824   146    0       0.000291    0.000026  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\%(\<\%(split\|while\|until\|if\|unless\)\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=//\@!
  0.003514   166    20      0.000078    0.000021  p6Include          \%(\k\|\K\@<=[-']\)\@<!\%(use\|require\)\%(\k\|[-']\K\@=\)\@!
  0.003469   146    0       0.000129    0.000024  p6StringAuto       \K\%(\k\|[-']\K\@=\)*p5\ze=>
  0.003462   146    0       0.000258    0.000024  p6Placeholder      \%(,\s*\)\@<=\$\%(\K\|\%([.^*?=!~]\|:\@<!::\@!\)\)\@!
  0.003452   146    0       0.000076    0.000024  p6Number           \%(\<0x\)\@<=\x[[:xdigit:]_]*
  0.003334   153    7       0.000093    0.000022  p6Variable         \%(\k\|\K\@<=[-']\)\@<!\%(self\)\%(\k\|[-']\K\@=\)\@!
  0.003315   166    20      0.000068    0.000020  p6Type             \%(::\|\k\|\K\@<=[-']\)\@<!\%(Bool\%(::True\|::False\)\?\)\%(\k\|[-']\K\@=\)\@!
  0.003223   147    1       0.000068    0.000022  p6Pragma           \%(\k\|\K\@<=[-']\)\@<!\%(oo\|fatal\)\%(\k\|[-']\K\@=\)\@!
  0.003204   146    0       0.000062    0.000022  p6Number           \%(\k\|\K\@<=[-']\)\@<!\%(NaN\|Inf\)\%(\k\|[-']\K\@=\)\@!
  0.003194   146    0       0.000120    0.000022  p6StringP5Auto     \K\%(\k\|[-']\K\@=\)*\ze\s\+p5=>

@chrisbra
Copy link
Member

chrisbra commented May 6, 2019

Did you verify this happens when started with vim --clean? Does it make a difference, if you use different regexpengine settings? Please also show the vim version with which you experience this. Thanks

@cdluminate
Copy link
Author

I've tried to reduce my .vimrc to only syntax on, the scrolling is still not smooth enough even if vam | grep install is empty. However, vim --clean is significantly smoother and it doesn't lose the syntax highlighting ... I don't understand. My vim version is 8.1.0875-2 from Debian Sid.

Full version info (vim --version):

VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 22 2019 12:55:04)
Included patches: 1-875, 878, 884, 948
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     +tag_old_static
+arabic            +farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    +tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +textprop
+byte_offset       -hangul_input      +num64             +timers
+channel           +iconv             +packages          +title
+cindent           +insert_expand     +path_extra        -toolbar
-clientserver      +job               +perl              +user_commands
-clipboard         +jumplist          +persistent_undo   +vartabs
+cmdline_compl     +keymap            +postscript        +vertsplit
+cmdline_hist      +lambda            +printer           +virtualedit
+cmdline_info      +langmap           +profile           +visual
+comments          +libcall           -python            +visualextra
+conceal           +linebreak         +python3           +viminfo
+cryptv            +lispindent        +quickfix          +vreplace
+cscope            +listcmds          +reltime           +wildignore
+cursorbind        +localmap          +rightleft         +wildmenu
+cursorshape       +lua               +ruby              +windows
+dialog_con        +menu              +scrollbind        +writebackup
+diff              +mksession         +signs             -X11
+digraphs          +modify_fname      +smartindent       -xfontset
-dnd               +mouse             +startuptime       -xim
-ebcdic            -mouseshape        +statusline        -xpm
+emacs_tags        +mouse_dec         -sun_workshop      -xsmp
+eval              +mouse_gpm         +syntax            -xterm_clipboard
+ex_extra          -mouse_jsbterm     +tag_binary        -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-nWVbVg/vim-8.1.0875=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm -lruby-2.5 -lpthread -lgmp -ldl -lcrypt -lm

@cdluminate
Copy link
Author

This perl6 file is what I'm editing: https://github.com/dupr/duprkit/blob/master/bin/flink

@chrisbra
Copy link
Member

chrisbra commented May 6, 2019

Check the output of :scriptnames to see what files have been loaded. Also please show the syntime report as mentioned by Dominique and best also provide a sample file that shows the slowness. And possibly try with different regexpengine settings.

@chrisbra
Copy link
Member

chrisbra commented May 6, 2019

Also regarding the perl6 runtime file. Try with an up to date file from the upstream repository https://github.com/vim-perl/vim-perl and possibly ask there regarding the syntax performance. Perhaps the problem has already been fixed there? I notice the perl6 syntax file hasn't seen any updates for a couple of years, so this might as well help.

@cdluminate
Copy link
Author

Check the output of :scriptnames to see what files have been loaded. Also please show the syntime report as mentioned by Dominique and best also provide a sample file that shows the slowness. And possibly try with different regexpengine settings.

The difference between vim and vim --clean in terms of scripts loaded:

--- bb	2019-05-06 06:53:10.501485303 +0000
+++ aa	2019-05-06 06:57:14.157262531 +0000
@@ -1,11 +1,26 @@
-/usr/share/vim/vim81/defaults.vim
+/usr/share/vim/vim81/colors/ron.vim
+/usr/share/vim/vim81/debian.vim
 /usr/share/vim/vim81/filetype.vim
 /usr/share/vim/vim81/ftplugin/perl6.vim
 /usr/share/vim/vim81/ftplugin.vim
 /usr/share/vim/vim81/indent/perl6.vim
 /usr/share/vim/vim81/indent.vim
+/usr/share/vim/vim81/plugin/getscriptPlugin.vim
+/usr/share/vim/vim81/plugin/gzip.vim
+/usr/share/vim/vim81/plugin/logiPat.vim
+/usr/share/vim/vim81/plugin/manpager.vim
+/usr/share/vim/vim81/plugin/matchparen.vim
+/usr/share/vim/vim81/plugin/netrwPlugin.vim
+/usr/share/vim/vim81/plugin/rrhelper.vim
+/usr/share/vim/vim81/plugin/spellfile.vim
+/usr/share/vim/vim81/plugin/tarPlugin.vim
+/usr/share/vim/vim81/plugin/tohtml.vim
+/usr/share/vim/vim81/plugin/vimballPlugin.vim
+/usr/share/vim/vim81/plugin/zipPlugin.vim
 /usr/share/vim/vim81/scripts.vim
 /usr/share/vim/vim81/syntax/perl6.vim
 /usr/share/vim/vim81/syntax/syncolor.vim
 /usr/share/vim/vim81/syntax/synload.vim
 /usr/share/vim/vim81/syntax/syntax.vim
+/usr/share/vim/vimrc
+~/.vimrc

The syntime stat looks like the follows:

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN                                                                               1,1           Top
  0.010721   36     5       0.000736    0.000298  p6Routine          \%(\k\|\K\@<=[-']\)\@<!\%(eager\|hyper\|substr\|index\|rindex\|grep\|map\|sort\|join\|lines\|hints\|chm
  0.004231   31     0       0.001076    0.000136  p6Normal           \%(\<\%(role\|grammar\|slang\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*
  0.004108   31     0       0.000726    0.000133  p6RegexName        \%(\<\%(regex\|rule\|token\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*
  0.003869   38     7       0.000340    0.000102  p6Type             \%(\k\|\K\@<=[-']\)\@<!\%(Object\|Any\|Junction\|Whatever\|Capture\|Match\|Signature\|Proxy\|Matcher\|P
  0.002891   31     0       0.000204    0.000093  p6HyperOp          \%(<<\)\?!\?\%(div\|%\|mod\|+&\|+<\|+>\|\~&\|?&\|\~<\|\~>\|+|\|+\^\|\~|\|\~\^\|?|\|?\^\|xx\|x\|\~\|&&\|
  0.002168   31     0       0.000182    0.000070  p6HyperOp          «\?!\?\%(div\|%\|mod\|+&\|+<\|+>\|\~&\|?&\|\~<\|\~>\|+|\|+\^\|\~|\|\~\^\|?|\|?\^\|xx\|x\|\~\|&&\|&\|al
  0.001647   31     0       0.000164    0.000053  p6Operator         \%(\k\|\K\@<=[-']\)\@<!\%(div\|x\|xx\|mod\|also\|leg\|cmp\|before\|after\|eq\|ne\|le\|lt\|gt\|ge\|eqv\|
  0.001619   35     5       0.000287    0.000046  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\%(\<\%(split\|while\|until\|if\|unless\)\|\.\.\|[-+*!~(\[{=]\)\s*\
  0.001586   31     0       0.000200    0.000051  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<m\s*:P\%(erl\)\?5\s*\)\@<=[]\@!" skip="\\]
  0.001396   31     0       0.000211    0.000045  p6String           \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<tr\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([/\
  0.001341   32     1       0.000139    0.000042  p6Float            \k\@<!_\@<!\%(\d\|__\@!\)*_\@<!\.\@<!\._\@!\.\@!\a\@!\%(\d\|_\)\+_\@<!\%([eE]_\@!\%(\d\|_\)\+\)\?
  0.001259   31     0       0.000231    0.000041  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([\"'
  0.001146   31     0       0.000209    0.000037  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\
  0.000955   31     0       0.000146    0.000031  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<m\s*:P\%(erl\)\?5\s*\)\@<=\z([\"'`|,$]\)
  0.000936   31     0       0.000080    0.000030  p6Property         \%(\k\|\K\@<=[-']\)\@<!\%(prec\|irs\|ofs\|ors\|export\|deep\|binary\|unary\|reparsed\|rw\|parsed\|cache
  0.000825   49     1       0.000050    0.000017  p6PodDelimEndRegion \%(^=end\>\)\@<=
  0.000794   31     0       0.000089    0.000026  p6FlowControl      \%(\k\|\K\@<=[-']\)\@<!\%(take\|do\|when\|next\|last\|redo\|return\|contend\|maybe\|defer\|default\|exi
  0.000739   31     0       0.000064    0.000024  p6ClosureTrait     \%(\k\|\K\@<=[-']\)\@<!\%(BEGIN\|CHECK\|INIT\|START\|FIRST\|ENTER\|LEAVE\|KEEP\|UNDO\|NEXT\|LAST\|PRE\|
  0.000693   31     0       0.000108    0.000022  p6BlockLabel       \%(^\s*\)\@<=\h\w*\s*::\@!\_s\@=
  0.000581   31     0       0.000113    0.000019  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=/
  0.000468   31     0       0.000037    0.000015  p6Float            \k\@<!_\@!\%(\d\|__\@!\)\+_\@<![eE]_\@!-\%(\d\|_\)\+
  0.000461   33     2       0.000045    0.000014  p6DeclareRoutine   \%(\k\|\K\@<=[-']\)\@<!\%(macro\|sub\|submethod\|method\|multi\|proto\|only\|rule\|token\|regex\|catego
  0.000458   31     0       0.000034    0.000015  p6TypeConstraint   \%(\k\|\K\@<=[-']\)\@<!\%(is\|as\|but\|trusts\|of\|returns\|handles\|where\|augment\|supersede\)\%(\k\|
  0.000455   42     11      0.000044    0.000011  p6VarStorage       \%(\k\|\K\@<=[-']\)\@<!\%(let\|my\|our\|state\|temp\|has\|constant\)\%(\k\|[-']\K\@=\)\@!
  0.000439   31     0       0.000037    0.000014  p6Attention        \%(\k\|\K\@<=[-']\)\@<!\%(ACHTUNG\|ATTN\|ATTENTION\|FIXME\|NB\|TODO\|TBD\|WTF\|XXX\|NOTE\)\%(\k\|[-']\K
  0.000435   35     4       0.000033    0.000012  p6Number           \k\@<!_\@!\%(\d\|__\@!\)\+_\@<!\%([eE]_\@!+\?\%(\d\|_\)\+\)\?_\@<!
  0.000413   31     0       0.000066    0.000013  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<m\s*:P\%(erl\)\?5\s*\)\@<=/
  0.000412   31     0       0.000070    0.000013  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\
  0.000407   31     0       0.000038    0.000013  p6Module           \%(\k\|\K\@<=[-']\)\@<!\%(module\|class\|role\|package\|enum\|grammar\|slang\|subset\)\%(\k\|[-']\K\@=\
  0.000363   31     0       0.000034    0.000012  p6Normal           \%(::\)\@<=\K\%(\k\|[-']\K\@=\)*
  0.000330   113    82      0.000019    0.000003  p6Variable         \%(@@\|[@&$%]\$*\)\%(::\|\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\)\|\K\)\@=
  0.000329   31     0       0.000026    0.000011  p6Repeat           \%(\k\|\K\@<=[-']\)\@<!\%(for\|loop\|repeat\|while\|until\|gather\|given\)\%(\k\|[-']\K\@=\)\@!
  0.000317   31     0       0.000026    0.000010  p6Normal           \K\%(\k\|[-']\K\@=\)*(\@=
  0.000309   31     0       0.000028    0.000010  p6Normal           \K\%(\k\|[-']\K\@=\)*\%(::\)\@=
  0.000298   35     4       0.000034    0.000009  p6Exception        \%(\k\|\K\@<=[-']\)\@<!\%(die\|fail\|try\|warn\)\%(\k\|[-']\K\@=\)\@!
  0.000272   31     0       0.000030    0.000009  p6ReverseCrossOp   [RX]!\?\%(div\|%\|mod\|+&\|+<\|+>\|\~&\|?&\|\~<\|\~>\|+|\|+\^\|\~|\|\~\^\|?|\|?\^\|xx\|x\|\~\|&&\|&\|al
  0.000258   31     0       0.000064    0.000008  p6Match            \%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@<!\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<={}\@!
  0.000251   33     2       0.000019    0.000008  p6Conditional      \%(\k\|\K\@<=[-']\)\@<!\%(if\|else\|elsif\|unless\)\%(\k\|[-']\K\@=\)\@!
  0.000249   31     0       0.000029    0.000008  p6Placeholder      \%(,\s*\)\@<=\$\%(\K\|\%([.^*?=!~]\|:\@<!::\@!\)\)\@!
  0.000244   31     0       0.000031    0.000008  p6StringAuto       \K\%(\k\|[-']\K\@=\)*\ze\%(p5\)\@<!=>
  0.000237   31     0       0.000019    0.000008  p6Property         \%(is\s\+\)\@<=\%(signature\|context\|also\|shape\)
  0.000223   31     0       0.000017    0.000007  p6Context          \%(\$\|@\|%\|&\|@@\)(\@=
  0.000211   20     0       0.000041    0.000011  p6PackageScope     \%(\K\%(\k\|[-']\K\@=\)*\)\?::
  0.000208   32     1       0.000015    0.000007  p6Operator         \%(:\@<!::\@!\|::=\|\.::\)
  0.000205   31     0       0.000017    0.000007  p6Number           \%(\<0x\)\@<=\x[[:xdigit:]_]*
  0.000201   31     0       0.000023    0.000006  p6StringAuto       \K\%(\k\|[-']\K\@=\)*p5\ze=>
  0.000196   31     0       0.000029    0.000006  p6ReduceOp         \k\@<!\[[R\\]\?!\?!\?\%(div\|%\|mod\|+&\|+<\|+>\|\~&\|?&\|\~<\|\~>\|+|\|+\^\|\~|\|\~\^\|?|\|?\^\|xx\|x\
  0.000196   31     0       0.000024    0.000006  p6StringAuto       \K\%(\k\|[-']\K\@=\)*\ze\s\+=>

I tried to set re=1 and foldmethod=manual following some solutions provided by stackoverflow and they indeed speeded vim up a bit. However still not as smooth as with vim --clean.

@cdluminate
Copy link
Author

Also regarding the perl6 runtime file. Try with an up to date file from the upstream repository https://github.com/vim-perl/vim-perl and possibly ask there regarding the syntax performance. Perhaps the problem has already been fixed there? I notice the perl6 syntax file hasn't seen any updates for a couple of years, so this might as well help.

https://github.com/vim/vim/blob/master/runtime/syntax/perl6.vim This syntax highlighting is faster than the one shipped by vim. Combining this updated perl6 syntax file, and re=1, foldmethod=manual, I'm basically satisfied with vim's smoothness (not --clean mode).

@chrisbra
Copy link
Member

chrisbra commented May 6, 2019

https://github.com/vim/vim/blob/master/runtime/syntax/perl6.vim

That is the one shipped by vim. I suppose you mean https://github.com/vim-perl/vim-perl6/blob/master/syntax/perl6.vim ?

Might want to ask at the vim-perl repository to send updated runtime files to Bram for distribution with Vim. Ah, there is issue vim-perl/vim-perl#249 but that seems to be resolved partially.

@cdluminate
Copy link
Author

That is the one shipped by vim. I suppose you mean https://github.com/vim-perl/vim-perl6/blob/master/syntax/perl6.vim ?

Ah, yes. I just copied the wrong URL.

Might want to ask at the vim-perl repository to send updated runtime files to Bram for distribution with Vim. Ah, there is issue vim-perl/vim-perl#249 but that seems to be resolved partially.

Umm... I poked them.

@chrisbra
Copy link
Member

chrisbra commented May 6, 2019

okay, closing then.

@chrisbra chrisbra closed this as completed May 6, 2019
@dpelle
Copy link
Member

dpelle commented May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants