dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.38k stars 1.42k forks source link

write-good, markdown causing very slow startup #1478

Closed mngyuan closed 6 years ago

mngyuan commented 6 years ago

Information

VIM version

NVIM v0.2.2 Build type: Release

Operating System: OS X 10.13.3

:ALEInfo

Current Filetype: markdown Available Linters: ['alex', 'markdownlint', 'mdl', 'proselint', 'redpen', 'remark-lint', 'textlint', 'vale', 'write-good'] Enabled Linters: ['alex', 'markdownlint', 'mdl', 'proselint', 'redpen', 'remark-lint', 'textlint', 'vale', 'write-good'] Linter Variables: let g:ale_markdown_mdl_executable = 'mdl' let g:ale_markdown_mdl_options = '' Global Variables: let g:ale_cache_executable_check_failures = 0 let g:ale_change_sign_column_color = 0 let g:ale_command_wrapper = '' let g:ale_completion_delay = 100 let g:ale_completion_enabled = 0 let g:ale_completion_max_suggestions = 50 let g:ale_echo_cursor = 1 let g:ale_echo_msg_error_str = 'Error' let g:ale_echo_msg_format = '%code: %%s' let g:ale_echo_msg_info_str = 'Info' let g:ale_echo_msg_warning_str = 'Warning' let g:ale_enabled = 1 let g:ale_fix_on_save = 1 let g:ale_fixers = {'javascript': ['prettier']} let g:ale_history_enabled = 1 let g:ale_history_log_output = 1 let g:ale_keep_list_window_open = 0 let g:ale_lint_delay = 200 let g:ale_lint_on_enter = 1 let g:ale_lint_on_filetype_changed = 1 let g:ale_lint_on_save = 1 let g:ale_lint_on_text_changed = 'always' let g:ale_lint_on_insert_leave = 0 let g:ale_linter_aliases = {} let g:ale_linters = {} let g:ale_linters_explicit = 0 let g:ale_list_window_size = 10 let g:ale_list_vertical = 0 let g:ale_loclist_msg_format = '%code: %%s' let g:ale_max_buffer_history_size = 20 let g:ale_max_signs = -1 let g:ale_maximum_file_size = 0 let g:ale_open_list = 0 let g:ale_pattern_options = {} let g:ale_pattern_options_enabled = 0 let g:ale_set_balloons = 0 let g:ale_set_highlights = 1 let g:ale_set_loclist = 1 let g:ale_set_quickfix = 0 let g:ale_set_signs = 1 let g:ale_sign_column_always = 0 let g:ale_sign_error = '>' let g:ale_sign_info = '-' let g:ale_sign_offset = 1000000 let g:ale_sign_style_error = '>' let g:ale_sign_style_warning = '-' let g:ale_sign_warning = '-' let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK'] let g:ale_type_map = {} let g:ale_warn_about_trailing_blank_lines = 1 let g:ale_warn_about_trailing_whitespace = 1 Command History: (executable check - failure) alex (executable check - failure) markdownlint (executable check - failure) mdl (executable check - failure) proselint (executable check - failure) redpen (executable check - failure) remark (executable check - failure) textlint (executable check - failure) vale (executable check - failure) write-good (executable check - failure) alex (executable check - failure) markdownlint (executable check - failure) mdl (executable check - failure) proselint (executable check - failure) redpen (executable check - failure) remark (executable check - failure) textlint (executable check - failure) vale (executable check - failure) write-good

What went wrong

15s startup time, extremely slow

interesting lines from --startuptime logging:

287.407  000.296  000.296: sourcing /Users/phorust/.vim/plugged/ale/ale_linters/markdown/write-good.vim
5175.369  000.024  000.024: sourcing /Users/phorust/.vim/plugged/html5.vim/ftplugin/html.vim
...
5254.662  000.046  000.046: sourcing /usr/local/Cellar/neovim/0.2.2_1/share/nvim/runtime/syntax/markdown.vim
10328.471  000.027  000.027: sourcing /Users/phorust/.vim/plugged/html5.vim/ftplugin/html.vim
...
10404.185  000.020  000.020: sourcing /usr/local/Cellar/neovim/0.2.2_1/share/nvim/runtime/syntax/markdown.vim
15331.148  000.202  000.202: sourcing /Users/phorust/.vim/plugged/ale/autoload/ale/pattern_options.vim

rest of output here: https://gist.github.com/phorust/2855d4915747b37bc4790663d0b451fc

Also looks like :ALEInfoToClipboard is making my nvim hang before it gets the full output so I used :ALEInfo instead

Is there a way to further profile while loading these .vim files is taking so long?

Reproducing the bug

Steps for repeating the bug:

  1. nvim README.md --startuptime vim.log in phorust/phorust.github.io
  2. Observe 15s startup time
w0rp commented 6 years ago

Are you sure ALE is to blame here? I don't notice any problems myself, and I can't see anything that would cause a long startup time.

arp242 commented 6 years ago

I also use write-good for Markdown files (have for a long time) and never noticed any performance problems, much less startup delays.

mngyuan commented 6 years ago

Ok, pretty confident now after removing polygot that this is polyglot's fault... I probably will just not use polyglot and add my own language plugins anywho. Sorry for the noise