On Sat, 10 Dec 2022 10:16:19 +0100
N i c o l a s I I T h e B l o o d y <[email protected]> wrote:
> I mean when i open 'tagbar.vim' in vim, about 4500 lines code.
> 
> I feel that the pb comes from the call of executable 'ctags': when you move
> Cursor vertically from top to down, it pass through several functions, and
> tagbar wants to show current function Cursor is in. So it calls many times
> 'ctags executable' and this is causes delay on my win11 Os.

That'll do it.  Executing binaries in Windows is costly.  I don't know
how tagbar works, but if it depends on the output of a system call
without saving the results for using later, it'll be slow in both
versions of VimScript _and_ Lua.  I had to deal with a similar situation
for a simple VimL function that made calls to 'git' three-four times.  I
solved it by relying on the fugitive plugin.  It saves the pertinent
values in buffer-local variables, so my VimL function didn't need to
call the 'git' binary.

To hammer home my point: if fugitive didn't save the frequently-used git
values, vim users couldn't use fugitive in Windows because of how slow
it would be to execute any fugitive command.

Windows is a pain.

> I am currently trying to port tagbar legacy to vim9script. But if i am
> right, the pb will still be there.

Most probably.

> I have noticed your advise Enan.
> Thank
> Nicolas

The name you assigned to your email address still has inter-letter
spaces.  See how the attribution text (see at the very beginning of this
email) spells your name with your email address?  That name comes from
the From: header of your email, which is set by either your email client
or, if you are using Google's web interface, your Google username.


P.S. You forgot to CC vim-dev list.  I'm appending your original email
with this email for posterity; see below after the marker for forwarded
message.


-- 
Enan
[email protected]
https://git.sr.ht/~enan/
https://www.github.com/3N4N



===== Begin forwarded message =====

Date: Sat, 10 Dec 2022 10:16:19 +0100
From: N i c o l a s I I T h e B l o o d y <[email protected]>
To: Enan Ajmain <[email protected]>
Subject: Re: Profile Cursor move (very slow)


I mean when i open 'tagbar.vim' in vim, about 4500 lines code.

I feel that the pb comes from the call of executable 'ctags': when you
move Cursor vertically from top to down, it pass through several
functions, and tagbar wants to show current function Cursor is in. So
it calls many times 'ctags executable' and this is causes delay on my
win11 Os.

I am currently trying to port tagbar legacy to vim9script. But if i am
right, the pb will still be there.

I have noticed your advise Enan.
Thank
Nicolas

Le sam. 10 déc. 2022 à 06:07, Enan Ajmain <[email protected]> a
écrit :

> On Fri, 9 Dec 2022 12:12:07 -0800 (PST)
> N i c o l a s I I T h e B l o o d y <[email protected]> wrote:  
> > Thank you Enan, I saw thé profile help but don't happen to find  
> particular  
> > sample for Cursor move.  
>
> That's because there is none.  Profiling, as defined in ':h profiling'
> only measures the runtime of either a script or a function, not a cursor
> move.
>
> I think you're looking for profiling because you want to see which
> function call or which command is consuming time when you move the
> cursor.  If that's correct, you could check what your arrow keys are
> mapped to.  Remember to invoke these commands from the exact buffer
> where arrows keys are slow.
>
>     :map <left>
>     :map <right>
>     :map <up>
>     :map <down>
>
> If the arrows are not mapped to any function call or user command, then
> the problem is somewhere else; see below.
>
> On Fri, 9 Dec 2022 08:36:18 -0800 (PST)
> You wrote:  
> > Vertical moving cursor with arrow keys on such a file
> > like https://github.com/preservim/tagbar/blob/master/autoload/tagbar.vim  
> is  
> > very very slow.  
>
> What did you mean by "such a file"?  Do you mean when you open
> 'tagbar.vim' in vim?  or do you mean when you are in the buffer created
> by the tagbar plugin?  If the latter, then that's a problem with the
> plugin and you should open a ticket in its issue tracker.
>
> P.S. The spaces between each letter in your name makes it hard to read.
> I would change it to a normal spelling.
>
> --
> Enan
> [email protected]
> https://git.sr.ht/~enan/
> https://www.github.com/3N4N
>  

===== End forwarded message =====

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221210161056.00000876%40gmail.com.

Raspunde prin e-mail lui