Vimjas / vim-python-pep8-indent

A nicer Python indentation style for vim.
Creative Commons Zero v1.0 Universal
790 stars 69 forks source link

this is my slowest plugin #117

Closed toejough closed 5 years ago

toejough commented 5 years ago

see my profile output in #116 ... also this plugin is responsible for my next slowest times:

FUNCTION  <SNR>102_is_concealed()
    Defined: ~/.vim/plugged/vim-python-pep8-indent/indent/python.vim line 71
Called 1994 times
Total time:   5.234862
 Self time:   5.234862

count  total (s)   self (s)
 1994              5.218897     let concealed = synconcealed(a:line, a:col)
 1994              0.012817     return len(concealed) && concealed[0]

In fact, my top 6 slowest functions during profiling are from this plugin:

   44  22.053020   5.826575  <SNR>102_find_opening_paren()
   11  11.127434   0.002370  GetPythonPEPIndent()
   11   5.558544   0.000384  <SNR>102_indent_like_opening_paren()
   11   5.545772   0.040339  <SNR>102_indent_like_previous_line()
   11   5.469701   0.000597  <SNR>102_find_start_of_multiline_statement()
 1994   5.234862             <SNR>102_is_concealed()

The next-slowest plugin is 5x faster. Are there any adjustments I can make? I like the plugin - best python indentation plugin I've found, but... this is really affecting my work.

blueyed commented 5 years ago

Closing as duplicate of #116.

blueyed commented 5 years ago

1994 5.234862 102_is_concealed()

This shows this issue in Vim: https://github.com/vim/vim/pull/3613 - skip appears to be evaluated too much. Can you try the Vim patch maybe?

Re the Vim patch: nevermind, appears to be intentional.