-
Notifications
You must be signed in to change notification settings - Fork 3
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
Atom Helper process takes up 100% CPU #32
Comments
Can you share a little on what your project looks like? For large projects, there will be an initial burst as import-js starts indexing all your javascript files. But the burst shouldn't last forever, plus the next time you run it things should be faster (it will reuse the old cache). That being said, you're likely going to get a better experience if you install Watchman as well. See the import-js readme for more on this. |
Thanks for a quick response. The project I first tested it on has 247 JavaScript source files + 102 SCSS files which are also imported. Its node_modules/ dir has 1165 packages.
I also tried it on a different project with 940 .js files, 227 .scss files, and 1016 packages in
So there must be some sort of odd difference between the projects, and it's not the plain number of files. |
One difference that might be important is that this first project makes heavy use of named exports (while the second one mostly uses default exports). |
I remembered that there were some large compiled .min.js files (around 1MB in size), which weren't listed in .gitignore. I deleted those as well. Initially it seemed that this didn't help... but then the CPU usage dropped down. I added the problematic directory to |
same problem here from time to time. I try to import something and atom hangs. I have watchman installed on the computer using brew. I have no clue whether importjs actually uses watchman though |
I started to experience this problem again too. I then went back to deleting all these problematic directories and files, and some more... and at one point it started to work again. Added some additional directories to exclude config... we'll see if this prevents the problem from coming back again in the future. At one point, during messing with this, I even got to the point where the import-js plugin stopped working completely (like the commands weren't even available from the menu). I uninstalled and re-installed it, to get it back to working state again. But there definitely are some problems in here with this... |
You should see something about this in the import-js logfile: I'd be interested to see more of what's in that logfile. Can you either share here or link to an uploaded gist @macrozone? |
@trotzig hi, This is my .importjs.js file now:
but no logfile is created. I restarted atom, but without luck. |
ok, i uninstalled importjs and reinstalled. Then i got a message about native modules that were built for an older version of atom and could rebuild it. after that, it started to work again. also logfile is now there |
Interesting. This could definitely be related to building the sqlite3 dependency (I have seen this come up several times in the past). I'm glad you found a workaround, and I hope this can help others running into the same issue. |
Quick question, are you on windows, linux or mac? |
mac os x high sierra. by the way, now the cpu issue is back, but nothing appear in the logfile :-( |
Is there anything in the dev console log in Atom? |
FYI, I'm also running the latest OSX. |
Same here OSX. AFAICT importjs is watching changes in my build directory, which is constantly being recreated. I have Project structure:
NOTE: I'm also using rollup plugins to transform |
@bennypowers If I'm not mistaken, only the project root I had a look at some of my own projects and their // .importjs.js
module.exports = {
excludes: ['./build/**'],
} Could you try changing your excludes config to see if it makes things better? |
Seems to have helped, thanks. Docs show without excludes: [
'react-components/**/test/**',
] |
Thanks for the callout! I made that change here: Galooshi/import-js@6e88abf |
Whenever I execute any of the atom-import-js commands, the CPU goes to 100% and everything in Atom becomes terribly slow.
This happens regardless of whether I run Atom in normal or in dev mode.
Output from
top
command:The text was updated successfully, but these errors were encountered: