Closed d3v-null closed 7 years ago
I think we can allow for terminating previously spawned processes for cpu intensive linters in the helper module atom-linter
. I don't think this should be the default behavior for all linters, but only for cpu intensive ones.
@Arcanemagus thoughts?
Isn't the functionality for this basically already implemented in exec
with the .kill()
functionality?
Something along these lines should be possible already:
exec
calls to a Set.kill(-9)
on any unresolved Promises in the Setnull
to Linter so it doesn't change any current results (of the new call to lint()
)None of the providers currently work this way though 😛.
Turns out that there are some additional things preventing this from being done in providers just using exec()
, so this is blocked on https://github.com/steelbrain/exec/issues/81 for now.
Closing in favor of https://github.com/steelbrain/atom-linter/issues/159
Hey! Firstly thank you for your work on linter so far, you've done an awesome job on v2 and should be immensely proud to have created such a polished and usable open source linter. Considering how many people are getting in to programming through languages like Python and using Atom, the fact that atom linter works so well out of the box (which wasn't a thing when I learnt to code on Notepad++ 10 years ago) is probably going to have a noticeable effect on code quality for the next generation of programmers. You rock 👍
Now, on to my suggestion: Something I've noticed is that if I have to refactor a large python repository, the default settings will cause huge CPU usage, if it takes a few seconds to run pylint on the file, even if that file is the only open file. This is because linter will keep calling the lint process, even before the previous lint has had time to finish, causing lints to stack up and snowball until the editor crawls to a halt. Even when according to that swirly blue/green dot in atom the lint has finished, the CPU usage stays very high on multiple cores. my When I turn off auto linting and lint manually, my CPU usage stays reasonable and only uses a few cores. The default settings make atom unusable on my computer for large files, and considering I have a pretty decent laptop, this would be a much more noticeable issue on a low powered device. When this happens I usually give up out of frustration and go back to Sublime which seems to handle lints just fine but the linter interface makes me miss atom-linter (it uses Anaconda)
What if linter either cancelled the previous lint or waited til the lint had finished / timed out before starting a new lint?
I'd love to help implement this feature. I've got a strong background in Python, my JS is a bit rusty but I should be able to figure it out, and I don't have much on this weekend. If you think I should take a crack at it, I'd love a quick brief on where to start.
Here are some CPU screenshots with and witout autolint:
I was going to send you the file that I had trouble linting, but it turns out it's not the file itself but the giant list of imports it brings in. If you want to try and recreate my problem, download this repo and open woogenerator/generator.py https://github.com/derwentx/WooGenerator . Sorry about how bloated the repo is. It's big but I've definitely had to use atom to trawl through larger repos.
Here are my specs:
System: