Sunday, October 2, 2016

Re: Slow Python syntax highlighting

François Ingelrest wrote:

> Hi Dominique,
>
> On 1 October 2016 at 09:46, Dominique Pellé wrote:
>> Can you provide a file where it happens and a minimalistic
>> vimrc, just enough to reproduce it?
>
> Here's what I came up with.
>
> If I type o to open a new line:
> - On line 87, it's instantaneous
> - On line 85, there's a noticeable lag
>
> With :syntax off, it's instantaneous in both cases. It may have
> something to do with indent as well, because turning off indent in the
> .vimrc solves the issue as well.


I downloaded your 2 files and started vim-8.0.20 huge on
Linux x86_64, compiled with gcc -O2 in a terminal like this:

$ vim -u -u vimrc --noplugin +85 foo.py

Then I pressed O. I did not observe an obvious difference
between lines 85 and 87. I then measured it and saw a difference:

3 measurement at line 85:

$ time ./vim -u vimrc --noplugin +85 -c 'norm! O' -c 'q!' foo.py

real 0m0.365s
user 0m0.230s
sys 0m0.033s

$ time ./vim -u vimrc --noplugin +85 -c 'norm! O' -c 'q!' foo.py

real 0m0.359s
user 0m0.221s
sys 0m0.035s

$ time ./vim -u vimrc --noplugin +85 -c 'norm! O' -c 'q!' foo.py

real 0m0.357s
user 0m0.239s
sys 0m0.019s

3 measurements at line 87:

$ time ./vim -u vimrc --noplugin +87 -c 'norm! O' -c 'q!' foo.py

real 0m0.267s
user 0m0.153s
sys 0m0.012s

$ time ./vim -u vimrc --noplugin +87 -c 'norm! O' -c 'q!' foo.py

real 0m0.269s
user 0m0.137s
sys 0m0.028s

$ time ./vim -u vimrc --noplugin +87 -c 'norm! O' -c 'q!' foo.py

real 0m0.267s
user 0m0.144s
sys 0m0.021s

OK, command O is measurably slower at line 85, but from your
email, it seemed like you observed a much longer delay than what
I see.

Interestingly, trying the old vim-7.4.52 (that comes with Ubuntu-14.04)
I see that it's much faster and takes about the same amount of time at line
at line 85 or 87:

$ time /usr/bin/vim -u vimrc --noplugin +85 -c 'norm! O' -c 'q!' foo.py

real 0m0.185s
user 0m0.059s
sys 0m0.027s

$ time /usr/bin/vim -u vimrc --noplugin +87 -c 'norm! O' -c 'q!' foo.py

real 0m0.176s
user 0m0.056s
sys 0m0.017s

I did not have the time yet to perform a bisection yet to see when
performance degraded, but I'll try later.

Can you also try to measure it automatically as I did? Just to make
sure that what I measure is what you also observe.

Regards
Dominique

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment