Vim Recall繁體中文

Profiling functions and scripts

:profile

Example

Normal 0 / 2

Profiling functions and scripts.

Profiler

v:profiling
0
Output destination
none
Before & after

Before

Profiler

v:profiling
0
Output destination
none

After

Profiler

v:profiling
1
Output destination
recall.profile
Selected functions/scripts
none; use profile func/file to select

Subject: :profile. Documentation-backed illustration; assumes +profile, writable fixture directory and a fresh Vim session with no prior profiling commands or retained function/file selectors; not replay-verified. Starts the profiler and selects the output path. No functions have been selected or measured; output is written on exit, profile stop, or profile dump.

Sample buffer
function! Work()
  return 7
endfunction
Cursor on line 1, column 1
Details & Vim help

Profiling functions and scripts. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :prof[ile] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.