Skip to content

vim plugin to display the kernprof profile results in the sign column

Notifications You must be signed in to change notification settings

cmosig/python-profile-column

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

python-profile-column

Vim plugin to display the kernprof profile results in the sign-column.

Installation

Simply use Vundle.

Functions

TLDR: RunAndPrintForeground() to save, execute (+profile) python script, and print output to the sign-column.

IMPORTANT: Python functions that you want profiled need to be annotated with @profile. Read the kernprof documentation for details.

  • RunKernprofBackground() runs the python script in the current buffer using kernprof -l <script> in the background. The script output is not visible.

  • RunKernprofForeground() runs the python script in the current buffer using !kernprof -l %.

  • UpdateProfileColumn() searches for output file of kernprof in the current directory and displays the percentages in Vim's signcolumn. The largest number is printed in a different color. Note that the sign-column can display a maximum of two characters and therefore 100 is displayed as 10.

  • RunAndPrintBackground() runs RunKernprofBackground() first and then UpdateProfileColumn().

  • RunAndPrintForeground() runs RunKernprofForeground() first and then UpdateProfileColumn().

Requirements

TODOs

  • create custom colors for better highlighting of profile results
  • catch handle functions in functions
  • functions without profile. e.g., when using joblib
  • add option to automatically load profile when opening file
  • make it faster
  • add docs

About

vim plugin to display the kernprof profile results in the sign column

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published