measure time betwween two normal commands

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

measure time betwween two normal commands

Ni Va
Hi,

Since some days, I notice that time to reach next occurence of a search  take time.

search foo

n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.

How can I find the plugin, measure by profile before and after n command?

Thank you

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: measure time betwween two normal commands

Bram Moolenaar

Ni Va wrote:

> Since some days, I notice that time to reach next occurence of a
> search  take time.
>
> search foo
>
> n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
>
> How can I find the plugin, measure by profile before and after n command?

I added more places to check for a timeout.  Esp. check if resetting
'hlsearch' helps.

To measure time:

        let start = reltime()
        normal n
        echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))

If you have a specfic pattern and text on which it is slow, please let
me know so that I can run the profiler with it.

--
hundred-and-one symptoms of being an internet addict:
52. You ask a plumber how much it would cost to replace the chair in front of
    your computer with a toilet.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: measure time betwween two normal commands

Ni Va
Le mardi 20 juin 2017 22:40:24 UTC+2, Bram Moolenaar a écrit :

> Ni Va wrote:
>
> > Since some days, I notice that time to reach next occurence of a
> > search  take time.
> >
> > search foo
> >
> > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> >
> > How can I find the plugin, measure by profile before and after n command?
>
> I added more places to check for a timeout.  Esp. check if resetting
> 'hlsearch' helps.
>
> To measure time:
>
> let start = reltime()
> normal n
> echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
>
> If you have a specfic pattern and text on which it is slow, please let
> me know so that I can run the profiler with it.
>
> --
> hundred-and-one symptoms of being an internet addict:
> 52. You ask a plumber how much it would cost to replace the chair in front of
>     your computer with a toilet.
>
>  /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org        ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
Hi Bram,

No specific pattern, it can be "set", "let", "foo", "bar".

Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?

Thank you

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: measure time betwween two normal commands

Ni Va
Le mardi 20 juin 2017 22:49:42 UTC+2, Ni Va a écrit :

> Le mardi 20 juin 2017 22:40:24 UTC+2, Bram Moolenaar a écrit :
> > Ni Va wrote:
> >
> > > Since some days, I notice that time to reach next occurence of a
> > > search  take time.
> > >
> > > search foo
> > >
> > > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> > >
> > > How can I find the plugin, measure by profile before and after n command?
> >
> > I added more places to check for a timeout.  Esp. check if resetting
> > 'hlsearch' helps.
> >
> > To measure time:
> >
> > let start = reltime()
> > normal n
> > echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
> >
> > If you have a specfic pattern and text on which it is slow, please let
> > me know so that I can run the profiler with it.
> >
> > --
> > hundred-and-one symptoms of being an internet addict:
> > 52. You ask a plumber how much it would cost to replace the chair in front of
> >     your computer with a toilet.
> >
> >  /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
> > ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> > \\\  an exciting new programming language -- http://www.Zimbu.org        ///
> >  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
>
> Hi Bram,
>
> No specific pattern, it can be "set", "let", "foo", "bar".
>
> Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?
>
> Thank you
Ok found. the winner is this mapping:
" nnoremap noh             :noh<cr> bad mapping

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: measure time betwween two normal commands

Bram Moolenaar
In reply to this post by Ni Va

Ni Va wrote:

> > > Since some days, I notice that time to reach next occurence of a
> > > search  take time.
> > >
> > > search foo
> > >
> > > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> > >
> > > How can I find the plugin, measure by profile before and after n command?
> >
> > I added more places to check for a timeout.  Esp. check if resetting
> > 'hlsearch' helps.
> >
> > To measure time:
> >
> > let start = reltime()
> > normal n
> > echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
> >
> > If you have a specfic pattern and text on which it is slow, please let
> > me know so that I can run the profiler with it.
> >
> > --
> > hundred-and-one symptoms of being an internet addict:
> > 52. You ask a plumber how much it would cost to replace the chair in front of
> >     your computer with a toilet.
> >
> >  /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
> > ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> > \\\  an exciting new programming language -- http://www.Zimbu.org        ///
> >  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
>
> Hi Bram,
>
> No specific pattern, it can be "set", "let", "foo", "bar".
>
> Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?

First thing I would do is find out if it is the search (unlikely) or
something related to redrawing the window (most likely).  You can find
out by searching for something that's already visible (no redraw) and
something that's further away (requires a redraw).

For the redraw, it can be syntax highlighting, folding, etc.

But keep in mind I changed the way timeouts are done in the regexp code,
if this checks the current time too often it will add overhead.  I would
need an example to figure out the balance between not timing out soon
and checking too often.

--
"I simultaneously try to keep my head in the clouds and my feet on the
ground.  Sometimes it's a stretch, though."              -- Larry Wall

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: measure time betwween two normal commands

Ni Va

Great, thanks!  For help and method.


Le 21 juin 2017 23:10, "Bram Moolenaar" <[hidden email]> a écrit :

Ni Va wrote:

> > > Since some days, I notice that time to reach next occurence of a
> > > search  take time.
> > >
> > > search foo
> > >
> > > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> > >
> > > How can I find the plugin, measure by profile before and after n command?
> >
> > I added more places to check for a timeout.  Esp. check if resetting
> > 'hlsearch' helps.
> >
> > To measure time:
> >
> >     let start = reltime()
> >     normal n
> >     echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
> >
> > If you have a specfic pattern and text on which it is slow, please let
> > me know so that I can run the profiler with it.
> >
> > --
> > hundred-and-one symptoms of being an internet addict:
> > 52. You ask a plumber how much it would cost to replace the chair in front of
> >     your computer with a toilet.
> >
> >  /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
> > ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> > \\\  an exciting new programming language -- http://www.Zimbu.org        ///
> >  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
>
> Hi Bram,
>
> No specific pattern, it can be "set", "let", "foo", "bar".
>
> Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?

First thing I would do is find out if it is the search (unlikely) or
something related to redrawing the window (most likely).  You can find
out by searching for something that's already visible (no redraw) and
something that's further away (requires a redraw).

For the redraw, it can be syntax highlighting, folding, etc.

But keep in mind I changed the way timeouts are done in the regexp code,
if this checks the current time too often it will add overhead.  I would
need an example to figure out the balance between not timing out soon
and checking too often.

--
"I simultaneously try to keep my head in the clouds and my feet on the
ground.  Sometimes it's a stretch, though."              -- Larry Wall

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...