You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
When I'm openning php file with 1k++ line syntastic is killing my vim (quad core machine - vim is using 110% cpu) 👎
Even with minimal syntastic config ..
Bundle 'Syntastic'letg:syntastic_check_on_open=1
When I'll comment out synstastic everythink is ok.
What can I do with that?
Regards,
Pawel
What happens if you leave out g:syntastic_check_on_open and start syntastic by running :SyntasticCheck manually? That is, does the load increase from the moment you start Vim, or only after you run :SyntasticCheck.
You appear to be running Linux with the SELinux patch. Have you tried disabling SELinux?
SELinux changes the semantic of the system calls. Try running this in Vim while syntastic is inactive: :echo executable("php"). Does it happen to trigger the increased load?
Any change if you run the test for a name that doesn't exist, f.i. :echo executable("some_dummy_name")?
As far as I can tell this is far more likely to be related to SELinux than to syntastic itself, but it's hard to be sure without root access. Perhaps ask you sysadmin to look at SELinux logs?
One more info.
Now I have tryied to open 230 lines php file. There are some problems with that file (php code sniffer shows 350 errors, 10 warningns, etc). Maybe showing that is a problem?
Well, syntastic runs some checkers against your files using the makeprg mechanism, then tries to parse the results with errorformat, and shows them nicely in a window. Some of the checkers rely on helper scripts to re-format the results, but they don't try to do anything clever beyond that. If your code sniffer runs slowly by itself, for whatever reasons, or if something like SELinux prevents some normal initialization steps, that isn't really syntastic's fault.
Ok, here's a quick profiling hack. Please add this patch: cd48979, run syntastic, then run :messages. This should produce a time trace, more or less like this:
Right, that rules out the patch level and SELinux. Sadly, I've also run out of potentially relevant ideas.
Well, I suppose you could still compile a version of Vim with profiling information, run it through strace / ltrace / truss / ktrace / whatever, look at kernel debugging logs, and all the related fun, but that doesn't seem like a good use of your time. :) Or perhaps post to the Vim list.
For what it's worth, I've never seen Vim at 100% CPU for more than a few fractions of a second at a time, and I have been using it for maybe 18 years, on all forms and shapes of UNIX incarnations, including Linux. shrug
A little late to the party ... try setting aside your current ~/.vim and ~/.vimrc and installing just the syntastic plugin in an otherwise empty configuration?
set nocompatible " be iMproved
filetype plugin on
" czesc configu zassana z https://github.com/spf13/spf13-vim/blob/3.0/.vimrc
scriptencoding utf-8
set number " numery linii
syntax on
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" " required!
Bundle 'gmarik/vundle'
Bundle 'twilight256.vim'
colorscheme twilight256 " kolorki
Bundle 'Syntastic'
" let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1
let g:syntastic_auto_jump=1
let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']
let g:syntastic_json_checkers=['jsonlint', 'jsonval']
let g:syntastic_twig_checkers=['twiglint']
let g:syntastic_auto_loc_list=1
let g:syntastic_enable_highlighting=1
let g:syntastic_echo_current_error=1
I have run into the issue with Vim taking a long to handle a file with a lot of errors. I use the following workarounds. It has been awhile since I looked into the problems, but I wrote down notes that may help. Of course, my notes may be wrong.
" Disable slow scanning of buffer.
" TODO: look if Syntastic is calling RefreshSigns for every error during a
" scan.
let g:syntastic_enable_signs=0
" Disable slow cursor movement.
" TODO: see if better autocmd than cursormoved or something with a delay
" because it is slow if there are a lot of errors.
let g:syntastic_echo_current_error=0
For this last one, I was thinking that the current error does not need to be updated for each line as I scroll quickly up or down the file. Maybe, the echo can be done when I release the cursor?
I'm just gonna leave it here: 0deeefd is still slow for me, I had to enable lazyredraw in Vim to make it usable again (600 lines of code file, ~170 warnings/errors/etc.), I suggest giving it a try.
There is little reason not to have lazyredraw set, that should be the default. Other common causes of slow scrolling are cursorcolumn and cursorline (via slow syntax highlighting patterns). You probably want them unset: set nocuc nocul.
That said, commit 0deeefd is already old, you should update to the current master HEAD and try again. If you still have problems please open a new issue, with a more explicit description.
I'm using 6574872, should've probably said so. As I said, enabling lazyrender seems to make it usable for me so I'm just leaving this note here with hope it helps someone.
As I noted in #655 (comment), scrolling is fast if the cursor is in the first column but slow in the last column of the line even with lazyredraw, nocuc and nocul set.
Something must be working awfully hard depending upon the column position.
@scfarley: That something is probably syntax highlighting, not syntastic. Ok, I'll add a note about profiling, so that you guys can see for yourselves what's going on.
As @scfarley pointed out, let g:syntastic_enable_signs=0 could be a viable solution. I just ran in to this issue, (100% CPU load, several seconds locked up) and that config setting improved performance to a usable level.
@jc00ke: Your problem is likely to be unrelated to the above. Please enable profiling cf. #688, and open a new issue. Please describe what you did, and add details about your config, your OS, your version of Vim, your version of syntastic, and the profiling logs.
Activity
lcd047 commentedon Mar 5, 2013
g:syntastic_check_on_openand start syntastic by running:SyntasticCheckmanually? That is, does the load increase from the moment you start Vim, or only after you run:SyntasticCheck.noose commentedon Mar 5, 2013
lcd047 commentedon Mar 5, 2013
SELinux changes the semantic of the system calls. Try running this in Vim while syntastic is inactive:
:echo executable("php"). Does it happen to trigger the increased load?noose commentedon Mar 5, 2013
:echo executable("php")
Everything is working just fine...
lcd047 commentedon Mar 5, 2013
Any change if you run the test for a name that doesn't exist, f.i.
:echo executable("some_dummy_name")?As far as I can tell this is far more likely to be related to SELinux than to syntastic itself, but it's hard to be sure without root access. Perhaps ask you sysadmin to look at SELinux logs?
noose commentedon Mar 5, 2013
Ok, I'll try to get logs from SELinux.
btw, :echo executable("some_dummy_name")
it's working fine... :-(
noose commentedon Mar 5, 2013
One more info.
Now I have tryied to open 230 lines php file. There are some problems with that file (php code sniffer shows 350 errors, 10 warningns, etc). Maybe showing that is a problem?
lcd047 commentedon Mar 5, 2013
Well, syntastic runs some checkers against your files using the
makeprgmechanism, then tries to parse the results witherrorformat, and shows them nicely in a window. Some of the checkers rely on helper scripts to re-format the results, but they don't try to do anything clever beyond that. If your code sniffer runs slowly by itself, for whatever reasons, or if something like SELinux prevents some normal initialization steps, that isn't really syntastic's fault.noose commentedon Mar 5, 2013
Checkers are very fast. Only drawing windows (buffers?) in vim is pain in the ... :-(
From my admin: "There is nothing in the SELinux logs". :-(
lcd047 commentedon Mar 5, 2013
Ok, here's a quick profiling hack. Please add this patch: cd48979, run syntastic, then run
:messages. This should produce a time trace, more or less like this:noose commentedon Mar 6, 2013
Thanks
lcd047 commentedon Mar 6, 2013
Ok, now please apply 18a64ce and re-run the test.
noose commentedon Mar 6, 2013
This is problem with SELinux?
lcd047 commentedon Mar 6, 2013
Now, 4.8 seconds in RefreshSigns() is beyond bizarre. Please apply 6833177 and re-run the test.
noose commentedon Mar 6, 2013
11 remaining items
lcd047 commentedon Mar 7, 2013
Right, that rules out the patch level and SELinux. Sadly, I've also run out of potentially relevant ideas.
Well, I suppose you could still compile a version of Vim with profiling information, run it through strace / ltrace / truss / ktrace / whatever, look at kernel debugging logs, and all the related fun, but that doesn't seem like a good use of your time. :) Or perhaps post to the Vim list.
For what it's worth, I've never seen Vim at 100% CPU for more than a few fractions of a second at a time, and I have been using it for maybe 18 years, on all forms and shapes of UNIX incarnations, including Linux. shrug
harleypig commentedon Mar 7, 2013
A little late to the party ... try setting aside your current ~/.vim and ~/.vimrc and installing just the syntastic plugin in an otherwise empty configuration?
noose commentedon Mar 8, 2013
.vimrc
:-(
harleypig commentedon Mar 8, 2013
Well, I meant everything, including Vundle, but I don't see how Vundle would be contributing to this. I have no more ideas to suggest. Sorry.
scfarley commentedon Mar 21, 2013
I have run into the issue with Vim taking a long to handle a file with a lot of errors. I use the following workarounds. It has been awhile since I looked into the problems, but I wrote down notes that may help. Of course, my notes may be wrong.
" Disable slow scanning of buffer.
" TODO: look if Syntastic is calling RefreshSigns for every error during a
" scan.
let g:syntastic_enable_signs=0
" Disable slow cursor movement.
" TODO: see if better autocmd than cursormoved or something with a delay
" because it is slow if there are a lot of errors.
let g:syntastic_echo_current_error=0
For this last one, I was thinking that the current error does not need to be updated for each line as I scroll quickly up or down the file. Maybe, the echo can be done when I release the cursor?
An example of a file that is slow to process:
https://github.com/rastersoft/Devede/blob/master/devede_video_convert.py
lcd047 commentedon Apr 13, 2013
The slow cursor movement is addressed in 0deeefd.
noose commentedon Apr 15, 2013
It is much better;-) Thanks! 👍
jstasiak commentedon Jun 11, 2013
I'm just gonna leave it here: 0deeefd is still slow for me, I had to enable
lazyredrawin Vim to make it usable again (600 lines of code file, ~170 warnings/errors/etc.), I suggest giving it a try.cc #463
lcd047 commentedon Jun 11, 2013
There is little reason not to have
lazyredrawset, that should be the default. Other common causes of slow scrolling arecursorcolumnandcursorline(via slow syntax highlighting patterns). You probably want them unset:set nocuc nocul.That said, commit 0deeefd is already old, you should update to the current master HEAD and try again. If you still have problems please open a new issue, with a more explicit description.
jstasiak commentedon Jun 11, 2013
I'm using 6574872, should've probably said so. As I said, enabling
lazyrenderseems to make it usable for me so I'm just leaving this note here with hope it helps someone.scfarley commentedon Jun 11, 2013
As I noted in #655 (comment), scrolling is fast if the cursor is in the first column but slow in the last column of the line even with lazyredraw, nocuc and nocul set.
Something must be working awfully hard depending upon the column position.
lcd047 commentedon Jun 12, 2013
@scfarley: That something is probably syntax highlighting, not syntastic. Ok, I'll add a note about profiling, so that you guys can see for yourselves what's going on.
jc00ke commentedon Apr 6, 2015
As @scfarley pointed out,
let g:syntastic_enable_signs=0could be a viable solution. I just ran in to this issue, (100% CPU load, several seconds locked up) and that config setting improved performance to a usable level.lcd047 commentedon Apr 7, 2015
@jc00ke: Your problem is likely to be unrelated to the above. Please enable profiling cf. #688, and open a new issue. Please describe what you did, and add details about your config, your OS, your version of Vim, your version of syntastic, and the profiling logs.