https://github.com/ichizok/vim-perf
Vim performance profiler, powered by gperftools.
https://github.com/ichizok/vim-perf
vim
Last synced: about 1 year ago
JSON representation
Vim performance profiler, powered by gperftools.
- Host: GitHub
- URL: https://github.com/ichizok/vim-perf
- Owner: ichizok
- Created: 2014-10-04T04:04:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-02-14T09:30:30.000Z (over 7 years ago)
- Last Synced: 2025-03-24T22:51:17.618Z (over 1 year ago)
- Topics: vim
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vim performance profiler, powered by gperftools
You can use gperftools via Vim script in order to profile Vim.
## Requirements
* [gperftools](https://github.com/gperftools/gperftools)
* Vim; built with `WE_ARE_PROFILING` macro
## Build Vim
Set `-DWE_ARE_PROFILING` to `CPPFLAGS`.
```
$ cd /path/to/vim
$ export CPPFLAGS=-DWE_ARE_PROFILING
$ ./configure --with-features=huge ...
$ make
```
## Build vim-perf library
```
$ cd /path/to/vim-perf
$ make
```
## Usage
```vim
set rtp+=/path/to/vim-perf
" load vim-perf library
call vimperf#setup()
" start cpu profiling
call vimperf#start("/path/to/result.out")
" or heap profiling
call vimperf#start("/path/to/result", "heap")
" ... profiling area ...
" stop profiling
call vimperf#stop()
" unload vim-perf library
call vimperf#finish()
```
**NOTE** If you'd like to use heap profiler, you have to link libtcmalloc to Vim before starting.
Linux: `LD_PRELOAD`
```
$ LD_PRELOAD=/path/to/libtcmalloc.so vim ...
```
macOS: `DYLD_INSERT_LIBRARIES`
```
$ DYLD_INSERT_LIBRARIES=/path/to/libtcmalloc.dylib vim ...
```