4

I've started to use guard to monitor my testing changes, but is using so much cpu (between 80%~95% of CPU). I'm using it in conjuction with all these guard gems

gem "guard-rspec"
gem 'guard-livereload'
gem 'guard-rails-assets'
gem 'guard-bundler'

I though maybe is just my laptop, but other coworkers use them in their new laptops(newer than mine) and is using about 60~70% of cpu all the time. I've tried to just run guard without all the other gems but the result is the same.

Is there a way to configure it and minimize their cpu usage?

4

1 に答える 1

6

はい、Guard を微調整してより効率的にすることができます。

  1. 効率的なファイルシステムの処理で説明されているように、OS ファイル システムの通知を有効にします。
  2. DSL メソッドを無視して、関心のないディレクトリを無視します。
  3. フィルタDSL メソッドを使用して、関心のあるファイル タイプへの変更をフィルタリングします。

多くのアクティブな Guard プラグインを含む大規模な Rails プロジェクトを監視している私の 2012 27 インチ iMac では、ファイルの変更をリッスンするときに、Guard プロセスが CPU 時間の 0.01% を占めています。

于 2013-01-10T09:00:49.263 に答える