Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Flycheck became slow when opening buffers since the 29 release #1129
Comments
|
See #1085 - for every new buffer we run |
NicolasPetton
commented
Oct 5, 2016
|
Thanks. The problem is that |
|
Thanks Nicolas. Do you have a publicly available example where it's that slow? Is it slow for a good reason, or should we file a bug report with them? |
|
I wonder if we should run |
|
@cpitclaudel How would we do that, from an implementation point of view? We need to make a synchronous decision about whether we use the checker or not, and how would we even run an arbitrary function asynchronously? @NicolasPetton |
NicolasPetton
commented
Oct 5, 2016
|
On this project https://github.com/foretagsplatsen/klassified it takes 0.8s on my laptop:
|
NicolasPetton
commented
Oct 5, 2016
|
I have other (private) repos where it takes 1.4s. Opening each buffer feels really slow. |
NicolasPetton
commented
Oct 5, 2016
|
I don't really like this solution, but could we have a variable that would bypass this check? It could be set as a dir-local var. |
|
As far as I'm concerned, no, we can't. We're running these predicates for a reason—if we allowed to circumvent them we might as well remove them entirely again. We should rather try and speed up the predicate instead of trying the cheap and easy way of just hacking around the issue. eslint takes 0.7s on the repo I just tried but to me that's not a delay large enough to warrant a workaround. |
NicolasPetton
commented
Oct 5, 2016
|
Yeah, I didn't like the approach either, but I don't know how we can speed up the predicate. |
|
@NicolasPetton Well, we can start with asking eslint why it takes the time it takes and whether they could probably provide a faster way to check for a configuration… |
|
Other option is to offload configuration from npm modules into your config file and check if that speeds anything up. |
Let me try to write a prototype :) I think it won't take much longer than explaining what I have in mind. |
lunaryorn
added
the
needs review
label
Oct 7, 2016
NicolasPetton
commented
Oct 17, 2016
|
@cpitclaudel Did you have time to try something? Otherwise contacting the eslint guys might be a good idea. |
lunaryorn
added
the
language support
label
Oct 17, 2016
|
@NicolasPetton You can talk to the eslint maintainers independently, for if |
|
@lunaryorn I don't think eslint deleopers can add faster option, but @NicolasPetton can try to contact them. They really need to parse whole config. For example you can specify that you want to use eslint extension inside config. That is additional npm package. They will check if that extension is installed. Also, if eslint is globally installed, those npm packages must be installed globally too. I think that from Flycheck standpoint, we choose best possible solution for this. Personally, I don't have any problems will my projects that use ESlint. I find for example opening ruby files when using jruby much more slower, but reason for that is also out of out hands. |
|
@Simplify Ah, yes, I didn't think of that… I'm constantly surprised on how complex the eslint configuration actually is Seems like we need to close this issue as |
|
Yeah, I didn't know that too, until I tested |
|
I'm closing this issue as |
lunaryorn
closed this
Oct 18, 2016
lunaryorn
added
wontfix
and removed
needs review
labels
Oct 18, 2016
|
Sorry for the delay :/ I tried writing something, but I ran into small issues. The idea was essentially this: instead of checking for the configuration, the "enabled" function would return nil immediately, and start the subprocess asynchronously. It would then, from a filter function, re-enable the checker if the check succeeded. I managed to get this mostly working, with one issue: we don't really have a distinction between disabled by the user and automatically disabled AFAICT. So if the user disabled the checker before the async check completed, it would get re-enabled. The code is here: https://github.com/cpitclaudel/flycheck/tree/1129-async-enabled |
|
If I understand the implementation aright all syntax check would silently skip over the check while it's |
|
That's right. Until the check completes eslint would be considered disabled, and if it succeeds the filter would put it back in the 'enabled' list, thus allowing it to be used for future checks. |
|
I kind of like the idea |
|
Sure thing; will do it soon. We'll see if we can turn it into something usable :) |
This was referenced Dec 8, 2016
eastwood
commented
Dec 19, 2016
|
Ah yes, I'm happy to test this feature, definitely noticing the slow down since |
kouhin
commented
Aug 2, 2017
|
Opening a javascript file gets extremely slow when using Make sure your eslint is set properly and add following code to your emacs config (with-eval-after-load 'flycheck
(advice-add 'flycheck-eslint-config-exists-p :override (lambda() t))) |
eastwood
commented
Aug 6, 2017
|
You're a legend sir!
On Wed, Aug 2, 2017 at 6:11 PM HOU Bin ***@***.***> wrote:
Opening a javascript file gets extremely slow when using --print-config.
Finally, I found a way to disable this feature
--
Excuse my brevity.
Sent from mobile device.
Clint
|
asimpson
commented
Aug 25, 2017
|
For those using (use-package flycheck
:config (advice-add 'flycheck-eslint-config-exists-p :override (lambda() t))
) |
NicolasPetton commentedOct 5, 2016
I updated flycheck from the last release (29) to the last version on Melpa (20161004.1257).
Opening JS buffers linted with eslint, it seems that flycheck freezes Emacs for 1 to 2 seconds. Once the buffer is open, I can't see any slowdown and flycheck operates normally. When disabling Flycheck, opening the buffer is instantaneous.
I'm not sure what changes between the last release and the last build on MELPA, if it's how flycheck runs when opening a buffer or if it has to do with how eslint is run.
I tried this with a clean (no config file loaded) Emacs v 25.1, with the following
Installing Flycheck 29 instead fixes the issue.