guard / guard-spork

Guard::Spork automatically manage Spork DRb servers
https://rubygems.org/gems/guard-spork
MIT License
296 stars 58 forks source link

long run time #27

Closed antonbaron closed 12 years ago

antonbaron commented 12 years ago

Hello and thanks for great project! I'm using guard-spork and guead-rspec only, with default Guardfile.

When the spork server is started it takes less than a second for a single test to run via direct command line call ($ rspec spec/requests/sample_spec.rb), while rspec guard runs this test for about 5 seconds from the moment it detects the change. guard-rspec is surely using spork, because it takes 15 secs on my netbook to run a test with environment loading.

Why is it so and can I get the 1-sec response with guard?

thibaudgg commented 12 years ago

Have you the bundle option to true (it's true by default). Using bundler can slow down the launch time a little bit.

antonbaron commented 12 years ago

No, I disabled everything except rspec, here's my guardfile:

guard 'spork', :rspec => true, :cucumber => false, :bundler => false, :test_unit => false, :rspec_env => { 'RAILS_ENV' => 'test' } do .... default watches end

guard 'rspec', :cli => '--drb', :version => 2 do ..... default watchers end

PS: calling system 'rspec path/to/spec.rb' from rails console is twice slower than direct call and is run in 2.3 seconds, according to Benchmark. 2.5 seconds are fine with me, but 5 seconds really slow my thoughts down.

antonbaron commented 12 years ago

Ok, I should have added the same option (:bundler => false) to guard 'rspec' line: .... guard 'rspec', :cli => '--drb', :version => 2, :bundler => false do .... default watchers end This makes guard execute tests in a second and me happy :)

thibaudgg commented 12 years ago

Good to hear!