comparison runtime/doc/repeat.txt @ 28373:2ddf8aa1252c v8.2.4712

patch 8.2.4712: only get profiling information after exiting Commit: https://github.com/vim/vim/commit/18ee0f603ebd3c091f6d2ab88e652fda32821048 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Fri Apr 8 13:23:19 2022 +0100 patch 8.2.4712: only get profiling information after exiting Problem: Only get profiling information after exiting. Solution: Add "profile dump" and "profile stop". (Marco Hinz, Yegappan Lakshmanan, closes #10107)
author Bram Moolenaar <Bram@vim.org>
date Fri, 08 Apr 2022 14:30:03 +0200
parents e3d6184b89fa
children 6dd88e45d47d
comparison
equal deleted inserted replaced
28372:efc1c3dc2b0d 28373:2ddf8aa1252c
1041 :source one_script.vim 1041 :source one_script.vim
1042 :exit 1042 :exit
1043 1043
1044 1044
1045 :prof[ile] start {fname} *:prof* *:profile* *E750* 1045 :prof[ile] start {fname} *:prof* *:profile* *E750*
1046 Start profiling, write the output in {fname} upon exit. 1046 Start profiling, write the output in {fname} upon exit or when
1047 a `:profile stop` or `:profile dump` command is invoked.
1047 "~/" and environment variables in {fname} will be expanded. 1048 "~/" and environment variables in {fname} will be expanded.
1048 If {fname} already exists it will be silently overwritten. 1049 If {fname} already exists it will be silently overwritten.
1049 The variable |v:profiling| is set to one. 1050 The variable |v:profiling| is set to one.
1050 1051
1052 :prof[ile] stop
1053 Write the collected profiling information to the logfile and
1054 stop profiling. You can use the `:profile start` command to
1055 clear the profiling statistics and start profiling again.
1056
1051 :prof[ile] pause 1057 :prof[ile] pause
1052 Don't profile until the following ":profile continue". Can be 1058 Don't profile until the following `:profile continue`. Can be
1053 used when doing something that should not be counted (e.g., an 1059 used when doing something that should not be counted (e.g., an
1054 external command). Does not nest. 1060 external command). Does not nest.
1055 1061
1056 :prof[ile] continue 1062 :prof[ile] continue
1057 Continue profiling after ":profile pause". 1063 Continue profiling after `:profile pause`.
1058 1064
1059 :prof[ile] func {pattern} 1065 :prof[ile] func {pattern}
1060 Profile function that matches the pattern {pattern}. 1066 Profile function that matches the pattern {pattern}.
1061 See |:debug-name| for how {pattern} is used. 1067 See |:debug-name| for how {pattern} is used.
1062 1068
1069 will also be profiled. 1075 will also be profiled.
1070 Note that profiling only starts when the script is loaded 1076 Note that profiling only starts when the script is loaded
1071 after this command. A :profile command in the script itself 1077 after this command. A :profile command in the script itself
1072 won't work. 1078 won't work.
1073 1079
1080 :prof[ile] dump
1081 Write the current state of profiling to the logfile
1082 immediately. After running this command, Vim continues to
1083 collect the profiling statistics.
1074 1084
1075 :profd[el] ... *:profd* *:profdel* 1085 :profd[el] ... *:profd* *:profdel*
1076 Stop profiling for the arguments specified. See |:breakdel| 1086 Stop profiling for the arguments specified. See |:breakdel|
1077 for the arguments. 1087 for the arguments. Examples: >
1078 1088 profdel func MyFunc
1089 profdel file MyScript.vim
1090 profdel here
1079 1091
1080 You must always start with a ":profile start fname" command. The resulting 1092 You must always start with a ":profile start fname" command. The resulting
1081 file is written when Vim exits. For example, to profile one specific 1093 file is written when Vim exits. For example, to profile one specific
1082 function: > 1094 function: >
1083 profile start /tmp/vimprofile 1095 profile start /tmp/vimprofile