tilt-dev / mish

57 stars 2 forks source link

mish spinning CPU when idle #3

Closed durka closed 6 years ago

durka commented 6 years ago

mish is idling at 10-20% CPU usage when I have the Millfile and some watched files open in vim but otherwise not doing anything. What's it doing?

maiamcc commented 6 years ago

Likely some files it's watching are changing b/c of system things as opposed to b/c of your edits. Something like .git, logs, etc. If you look at the status bar at the bottom right, does it list queued files that you wouldn't expect, and/or does the "revision" number unexpectedly tick up?

Short term solution is to ignore those files when calling watch, e.g.:

watch("**", "!.git/**", "node_modules/**", "**/*.log)

Lmk if that gets your CPU usage down to a reasonable level.

We're working on figuring out a longer-term solution.

maiamcc commented 6 years ago

...wait I lied, this might be a completely different bug.

Next question: what OS are you running?

durka commented 6 years ago

Yeah, I figured that's what might be happening, since this is a Rust project and the compiler creates zillions of files (ok... only ~1,500 files) under target/*/incremental/* and stuff. But I tried adding all that to the Millfile and it didn't help (it did reduce the "Revision" number though!).

Here is the Millfile:

watch("**", "!.git/**", "!**/*.sw*", "!**/*~", "!target/**")
autorun("./Cargo.toml", "**/*.rs")

sh("cargo build")
sh("RUST_BACKTRACE=1 cargo test")

I'm running macOS High Sierra 10.13.4.

maiamcc commented 6 years ago

Ha alright, this was two different bugs -- a comprehensive ignore list for watch solves one, and we've got a change in flight to solve the other, stay tuned.

maiamcc commented 6 years ago

@durka should be fixed by 4c2d5c7, lmk if you're still seeing issues.

durka commented 6 years ago

Down to ~1% now!