[vim/vim] erlangBitType exec time (#5593)

12 views
Skip to first unread message

Marcus Johansson

unread,
Feb 7, 2020, 3:57:54 PM2/7/20
to vim/vim, Subscribed

Describe the bug
I wouldn't describe this as a bug, just letting you know.
The erlangBitType syntax match expression may cause significant lag when scrolling/redrawing.

To Reproduce
Edit any file with relatively long lines with bit syntax.
You can e.g. :set relativenumber just to make it more obvious, but but required.
This is a typical output of :syntime report after jumping 5 times.

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN                                                                                            
  0.373476   3437   3186    0.002456    0.000109  erlangBitType      ...
  0.035630   251    0       0.000770    0.000142  erlangMacro        ...
  0.022778   2186   1944    0.002006    0.000010  erlangOperator     ...

Expected behavior
Matchtime/count of erlangBitType simillar to all others

Version
All versions I've tested. e.g. vim 8.0, neovim


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

K.Takata

unread,
Feb 7, 2020, 4:19:14 PM2/7/20
to vim/vim, Subscribed

https://github.com/vim/vim/blob/f2460a3aec89e70d4bab8d2369ee3f78cc43f09a/runtime/syntax/erlang.vim#L91

At a glance, the \%(\/\%(\s\|\n\|%.*\n\)*\)\@<= part looks very slow.
How about changing \@<= to \zs?

Christian Brabandt

unread,
Feb 7, 2020, 4:53:31 PM2/7/20
to vim/vim, Subscribed
Looks like an expansive pattern. You might want to discuss this with the maintainer of the file, mentioned at the top. Perhaps he has an idea how to improve it (e.g. use \zs instead of the look around or at least limit the look around)

> Am 07.02.2020 um 22:18 schrieb K.Takata <notifi...@github.com>:
>
> 

> https://github.com/vim/vim/blob/f2460a3aec89e70d4bab8d2369ee3f78cc43f09a/runtime/syntax/erlang.vim#L91
>
> At a glance, the \%(\/\%(\s\|\n\|%.*\n\)*\)\@<= part looks very slow.
> How about changing \@<= to \zs?
>
> —

dkearns

unread,
Mar 25, 2026, 3:36:01 AM (yesterday) Mar 25
to vim/vim, Subscribed
dkearns left a comment (vim/vim#5593)

@hcs42, have you seen this? I'm triaging issues and was hoping to close this.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/5593/4124394532@github.com>

Reply all
Reply to author
Forward
0 new messages