Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopping old instances of PyLint when requesting new ones #11

Closed
bivald opened this issue Sep 4, 2018 · 9 comments
Closed

Stopping old instances of PyLint when requesting new ones #11

bivald opened this issue Sep 4, 2018 · 9 comments

Comments

@bivald
Copy link

bivald commented Sep 4, 2018

First of all, I love this plugin. I really want to see it grow and I will try to help out any way I can.

Is your feature request related to a problem? Please describe.
Two scenarios:

  1. If I run Inspect Code a few times, fixing bugs I can easily get 20 python processess all running PyLint all using 100% each. Up to 40 python processes for lint on save.
    image

  2. If I jump around looking for things in my source I get a lot of Python processes, since PyLint is executed every time a file comes into view. A 300-400 line python file can easily take 5-10 seconds to lint.

Describe the solution you'd like
It would be nice of one could enable a feature that will abort the previously running PyLints when running a new Inspect Code. That way the old ones won't keep stacking up when they are irrelevant.

Describe alternatives you've considered
Speeding up PyLint (but that requires more cores usually, which might be counter intuitive. Some warning that PyLint won't run again since it's already running in the background.

Additional context
This is a hard thing to implement and I'm not sure what the best course of action would be. Perhaps options such as:

  1. Only run PyLint on save
  2. Kill old PyLint processess on Inspect Code
  3. Only run PyLint on Code Inspection (not on save)
  4. Kill old PyLint processess on save (when run PyLint on save is enabled)

Questions

  • Does PyLint run every time a file comes into focus? It seems to run when changing tabs as well, and not just when opening it for the first time.
  • If you have a Code Inspection window, is that continuously updated once the first scan is complete? (since that might trigger a lot, if you have a few open)
@leinardi
Copy link
Owner

leinardi commented Sep 5, 2018

Hey, this seems to be quite a hard issue to fix, I have to investigate more if the IntelliJ Platform SDK offers already something that could help.

If the real-time inspection is consuming too many resources just keep in mind that, as temporary workaround, you can always disable it, just for the Pylint plugin, and only use the on-demand check:
image

To answer your questions I have to do some tests and currently I can't, I will try to answer this evening.

@bivald
Copy link
Author

bivald commented Sep 5, 2018

Agreed, and it’s definitely possible it won’t be possible to fix it (since it’s not a bug per se). I will try to do my own digging as well.

@switchtrue
Copy link

This is becoming a real issue for me. It pretty well breaks pycharm after a while. But as suggested, disabling the real-time scan fixes the issue.

@stale
Copy link

stale bot commented Nov 26, 2018

This issue has been automatically marked as stale because it has not had activity in the last 60 days.

@stale stale bot added the Status: Stale label Nov 26, 2018
@SHxKM
Copy link

SHxKM commented May 27, 2019

I'm also experiencing very serious consequences of this.

@stale stale bot removed the Status: Stale label May 27, 2019
@stale
Copy link

stale bot commented Jul 26, 2019

This issue has been automatically marked as stale because it has not had activity in the last 60 days.

@stale stale bot added the Status: Stale label Jul 26, 2019
@chilicheech
Copy link

It would be really nice to have this implemented. Specifically the killing of old pylint processes when it triggers new ones. Gotta keep track of which pylint processes it triggered in the past and only kill those to prevent killing pylint processes that don't belong to it.

@leinardi
Copy link
Owner

leinardi commented Dec 4, 2021

Thanks to @intgr's contribution to the Mypy Plugin, this feature has now been ported also to this plugin.

@leinardi
Copy link
Owner

leinardi commented Dec 5, 2021

A new version with the fix for this issue is currently pending review from JetBrains. It should become available in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants