gobblejs / gobble

The last build tool you'll ever need
333 stars 20 forks source link

Pathwatcher #92

Closed heavyk closed 8 years ago

heavyk commented 8 years ago

hi @Rich-Harris

I noticed the gobble process for our project (it has a lot of files) was using a shitload of cpu while idle. I looked into it and it was all the polling done by chokidar. the cpu was churning away on the 100 zillion files being watched/served by gobble. so, I decided I would upgrade chokidar to pathwatcher. it's used in the atom editor and runs fine on windows, linux and osx.

so check this: after doing the conversion what was previously 3-7% constant cpu usage on the gobble process (once, up to 12% when I didn't restart the process for about a week) -- has now become literally zero. none. not one bit. I am not seeing such huge memory blowout over time either.

been testing this for a little while now and it's solid as a rock man.

super happy! cheers!

heavyk commented 8 years ago

ooops got an error on travis. it's true I didn't try it on linux yet.

I'll get it working. our servers are linux :)

heavyk commented 8 years ago

got it!

had to refactor the code because the tests stop and start a bunch (and I forgot to clean the garbage). then, I had to use clang for travis (because they have an old gcc which doesn't support c++0x).

ok, good nite

Rich-Harris commented 8 years ago

Hey @heavyk, sorry for leaving this open so long! Haven't had a chance to check in on this project in a while. Will admit I haven't tried pathwatcher but if it's used in Atom then it's bound to be pretty solid, and it sounds like you've had a good experience with it so :+1:. We can always revert later if it turns out to be a bad move, but I have a good feeling. Will try and push out a new release this weekend. Thanks

Swatinem commented 8 years ago

:+1: Sounds nice! I have also seen it constantly pegging the CPU, but not that high. It was maxing one core though when I had a watch on node_modules once. So I’m happy to see that solved. Also looking for the lower memory usage that you mentioned. It could reach up to ~800M for me through a few days of usage with a lot of rebuilds.