[vim/vim] Port the support for ':profile stop' and ':profile dump' commands from Neovim (PR #10107)

20 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Apr 7, 2022, 1:08:28 AM4/7/22
to vim/vim, Subscribed

This PR includes the following changes made in Neovim:

Author: Marco Hinz mh.co...@gmail.com
Commit: neovim/neovim@1902ee5
Commit: neovim/neovim@588bf76


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/10107

Commit Summary

  • 4acd237 Port the support for ':profile stop' and ':profile dump' commands from Neovim

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 1:22:02 AM4/7/22
to vim/vim, Push

@yegappan pushed 1 commit.

  • dcd533f Fix build error on MS-Windows


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107/push/9560098326@github.com>

codecov[bot]

unread,
Apr 7, 2022, 1:30:28 AM4/7/22
to vim/vim, Subscribed

Codecov Report

Merging #10107 (4e189d3) into master (3ad2090) will decrease coverage by 80.00%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@

##           master   #10107       +/-   ##

===========================================

- Coverage   82.01%    2.00%   -80.01%     

===========================================

  Files         167      152       -15     

  Lines      187584   170750    -16834     

  Branches    42269    39504     -2765     

===========================================

- Hits       153848     3430   -150418     

- Misses      21387   166625   +145238     

+ Partials    12349      695    -11654     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 2.00% <0.00%> (-0.01%) ⬇️
linux 2.00% <0.00%> (-81.96%) ⬇️
mingw-x64-HUGE-gui ?
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/profiler.c 0.00% <0.00%> (-86.12%) ⬇️
src/libvterm/src/rect.h 0.00% <0.00%> (-96.78%) ⬇️
src/sha256.c 0.00% <0.00%> (-96.45%) ⬇️
src/libvterm/src/parser.c 0.00% <0.00%> (-95.91%) ⬇️
src/gui_gtk_f.c 0.00% <0.00%> (-94.72%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-94.12%) ⬇️
src/vim9compile.c 0.00% <0.00%> (-92.42%) ⬇️
src/debugger.c 0.00% <0.00%> (-92.23%) ⬇️
src/eval.c 0.10% <0.00%> (-92.18%) ⬇️
src/blob.c 0.00% <0.00%> (-91.93%) ⬇️
... and 154 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ad2090...4e189d3. Read the comment docs.


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/pull/10107/c1091096678@github.com>

Dominique Pellé

unread,
Apr 7, 2022, 3:46:35 AM4/7/22
to vim/vim, Subscribed

@dpelle commented on this pull request.


In runtime/doc/repeat.txt:

> @@ -1071,6 +1074,9 @@ For example, to profile the one_script.vim script file: >

 		after this command.  A :profile command in the script itself

 		won't work.

 

+:prof[ile] dump

+               Don't wait until exiting Vim and write the current state of

+               profiling to the log immediately.

 

 :profd[el] ...						*:profd* *:profdel*

Slightly off-topic, but I don't find the doc of :profdel clear.


In runtime/doc/repeat.txt:

> @@ -1048,6 +1048,9 @@ For example, to profile the one_script.vim script file: >

 		If {fname} already exists it will be silently overwritten.

 		The variable |v:profiling| is set to one.

 

+:prof[ile] stop

+               Write the logfile and stop profiling.

I have not tried yet, but what happens if I call :profile stop twice in a row?

I also see that behavior of calling :profile start … twice is not documented (already the case prior to your change).

Also what happens if we call :profile dump without prior call to :profile start …?


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/pull/10107/review/934619399@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 9:52:38 AM4/7/22
to vim_dev, reply+ACY5DGGBIZZIG65D5B...@reply.github.com, vim/vim, Subscribed
Hi,

On Thu, Apr 7, 2022 at 12:46 AM Dominique Pellé <vim-dev...@256bit.org> wrote:

@dpelle commented on this pull request.


In runtime/doc/repeat.txt:

> @@ -1071,6 +1074,9 @@ For example, to profile the one_script.vim script file: >

 		after this command.  A :profile command in the script itself

 		won't work.

 

+:prof[ile] dump

+               Don't wait until exiting Vim and write the current state of

+               profiling to the log immediately.

 

 :profd[el] ...						*:profd* *:profdel*

Slightly off-topic, but I don't find the doc of :profdel clear.


In runtime/doc/repeat.txt:

> @@ -1048,6 +1048,9 @@ For example, to profile the one_script.vim script file: >

 		If {fname} already exists it will be silently overwritten.

 		The variable |v:profiling| is set to one.

 

+:prof[ile] stop

+               Write the logfile and stop profiling.

I have not tried yet, but what happens if I call :profile stop twice in a row?


The second time, the error message "E750: First use ":profile start {fname}" will be displayed.
 

I also see that behavior of calling :profile start … twice is not documented (already the case prior to your change).

Also what happens if we call :profile dump without prior call to :profile start …?



If ":profile dump" is called without a start, then the error message "E750: First use ":profile start {fname}"
will be displayed.

- Yegappan

vim-dev ML

unread,
Apr 7, 2022, 9:52:55 AM4/7/22
to vim/vim, vim-dev ML, Your activity

Hi,

On Thu, Apr 7, 2022 at 12:46 AM Dominique Pellé ***@***.***>
wrote:

> ***@***.**** commented on this pull request.
> ------------------------------
>
> In runtime/doc/repeat.txt
> <https://github.com/vim/vim/pull/10107#discussion_r844822293>:

>
> > @@ -1071,6 +1074,9 @@ For example, to profile the one_script.vim script file: >
>
> after this command. A :profile command in the script itself
>
> won't work.
>
>
>
> +:prof[ile] dump
>
> + Don't wait until exiting Vim and write the current state of
>
> + profiling to the log immediately.
>
>
>
> :profd[el] ... *:profd* *:profdel*
>
>
> Slightly off-topic, but I don't find the doc of :profdel clear.
> ------------------------------
>
> In runtime/doc/repeat.txt
> <https://github.com/vim/vim/pull/10107#discussion_r844822380>:

>
> > @@ -1048,6 +1048,9 @@ For example, to profile the one_script.vim script file: >
>
> If {fname} already exists it will be silently overwritten.
>
> The variable |v:profiling| is set to one.
>
>
>
> +:prof[ile] stop
>
> + Write the logfile and stop profiling.
>
>
> I have not tried yet, but what happens if I call :profile stop twice in a
> row?
>

The second time, the error message "E750: First use ":profile start
{fname}" will be displayed.


> I also see that behavior of calling :profile start … twice is not
> documented (already the case prior to your change).
>
> Also what happens if we call :profile dump without prior call to :profile
> start …?
>
>
>
If ":profile dump" is called without a start, then the error message "E750:
First use ":profile start {fname}"
will be displayed.

- Yegappan


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/pull/10107/c1091767782@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 9:58:44 AM4/7/22
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107/push/9564662863@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 9:58:58 AM4/7/22
to vim/vim, vim-dev ML, Push

@yegappan pushed 2 commits.

  • 639db40 Port the support for ':profile stop' and ':profile dump' commands from Neovim
  • d9b95e2 Update help file

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107/push/9564665567@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 11:48:43 AM4/7/22
to vim/vim, vim-dev ML, Push

@yegappan pushed 2 commits.

  • 569c3d7 Port the support for ':profile stop' and ':profile dump' commands from Neovim
  • 38e5d17 Update help file

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107/push/9565829010@github.com>

Bram Moolenaar

unread,
Apr 7, 2022, 1:58:14 PM4/7/22
to vim/vim, vim-dev ML, Comment

Just to be clear:

  • After "profile dump" profiling continues as before, adding to the already collected stats?
  • After "profile stop" one can use "profile start" again and it will use a clean slate? Thus doing "profile start / some work / profile stop" twice would give very similar results?
    Would be good to make this clear in the help.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/10107/c1092035638@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 11:03:17 PM4/7/22
to vim_dev, reply+ACY5DGCIFOE6L247HH...@reply.github.com, vim/vim, vim-dev ML, Comment
Hi Bram,

On Thu, Apr 7, 2022 at 10:58 AM Bram Moolenaar <vim-dev...@256bit.org> wrote:

Just to be clear:

  • After "profile dump" profiling continues as before, adding to the already collected stats?

Yes. After executing the ":profile dump" command, the profiling continues and adds to the
already collected stats.
 
  • After "profile stop" one can use "profile start" again and it will use a clean slate? Thus doing "profile start / some work / profile stop" twice would give very similar results?

Yes. The new tests already use the above sequence of commands.
 
  • Would be good to make this clear in the help.



Will update the help to reflect this.

Regards,
Yegappan 

vim-dev ML

unread,
Apr 7, 2022, 11:03:34 PM4/7/22
to vim/vim, vim-dev ML, Your activity

Hi Bram,

On Thu, Apr 7, 2022 at 10:58 AM Bram Moolenaar ***@***.***>

wrote:

> Just to be clear:
>
> - After "profile dump" profiling continues as before, adding to the

> already collected stats?
>
>
Yes. After executing the ":profile dump" command, the profiling continues
and adds to the
already collected stats.


>
> - After "profile stop" one can use "profile start" again and it will

> use a clean slate? Thus doing "profile start / some work / profile stop"
> twice would give very similar results?
>
>
Yes. The new tests already use the above sequence of commands.


>
> - Would be good to make this clear in the help.

>
>
>
Will update the help to reflect this.

Regards,
Yegappan


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107/c1092395570@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 11:12:10 PM4/7/22
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.

  • c5e0244 Update the docs and the test

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107/push/9570249929@github.com>

Yegappan Lakshmanan

unread,
Apr 7, 2022, 11:12:29 PM4/7/22
to vim/vim, vim-dev ML, Push

@yegappan pushed 2 commits.

  • 32b4ba6 Port the support for ':profile stop' and ':profile dump' commands from Neovim
  • 6a929d0 Update the docs and the test

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10107/push/9570251585@github.com>

Bram Moolenaar

unread,
Apr 8, 2022, 8:23:46 AM4/8/22
to vim/vim, vim-dev ML, Comment

Closed #10107 via 18ee0f6.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/10107/issue_event/6396065920@github.com>

Reply all
Reply to author
Forward
0 new messages