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