Loading ...
Sorry, an error occurred while loading the content.

rails test slow on Windows

Expand Messages
  • Thomas Olausson
    Any other rails developer with crawling test performance on Windows? When I run my rails unit tests, I ve noticed that even though the ruby unit test reports
    Message 1 of 10 , Jan 12, 2007
    View Source
    • 0 Attachment
      Any other rails developer with crawling test performance on Windows?

      When I run my rails unit tests, I've noticed that even though the
      ruby unit test reports the time to run mosts simple tests is less
      than a second,
      in actuality, waiting for rails to init and to get the command prompt
      back, is way more.


      Check out these stats, I'm running a test case on three different
      hardware
      # ruby 1.8.5+rails 1.1.6 on both machines )
      # test_helper initializes rails )
      # a mysql instance is running on localhost, database.yml is pointing
      to localhost )

      require File.dirname(__FILE__) + '/../test_helper'
      class OrangeTest < Test::Unit::TestCase
      def test_truth
      p "dude"
      assert true
      end
      end

      1. run on my Intel Mac: (Dual Core 2ghz)
      time ruby test/unit/orange_test.rb
      --> time is average 1.1 seconds

      2. run on my job PC (P4, 2.8Ghz)
      echo |. time
      ruby test\unit\orange_test.rb
      echo |. time
      --> time is average 5-6 seconds

      3. run on windows virtualized in Parallels on my Intel Mac
      echo |. time
      ruby test\unit\orange_test.rb
      echo |. time
      --> time is average 3.5 seconds

      Running the same tests over and over, causes a lot of micro stress
      for me.
      I am unfortunate to do most of my work on that P4 2.8Ghz, but it
      shouldn't be 5 times slower than my mac.

      Anyone with similar experience?
      The chance for me to get a mac at work, is slim, since I work for an
      insurance company. hehe.

      /Thomas
    • J. David Beutel
      I have no Ruby experience, but wonder if there s a Ruby shell that you could leave running to avoid the init overhead. Cheers, 11011011 Thomas Olausson
      Message 2 of 10 , Jan 12, 2007
      View Source
      • 0 Attachment
        I have no Ruby experience, but wonder if there's a Ruby shell that you
        could leave running to avoid the init overhead.

        Cheers,
        11011011

        Thomas Olausson <thomas.olausson@...> wrote on Friday, January 12,
        2007 12:20:03:
        > Any other rails developer with crawling test performance on Windows?
        >
        > When I run my rails unit tests, I've noticed that even though the
        > ruby unit test reports the time to run mosts simple tests is less
        > than a second,
        > in actuality, waiting for rails to init and to get the command prompt
        > back, is way more.
        >
        >
        > Check out these stats, I'm running a test case on three different
        > hardware
        > # ruby 1.8.5+rails 1.1.6 on both machines )
        > # test_helper initializes rails )
        > # a mysql instance is running on localhost, database.yml is pointing
        > to localhost )
        >
        > require File.dirname(__FILE__) + '/../test_helper'
        > class OrangeTest < Test::Unit::TestCase
        > def test_truth
        > p "dude"
        > assert true
        > end
        > end
        >
        > 1. run on my Intel Mac: (Dual Core 2ghz)
        > time ruby test/unit/orange_test.rb
        > --> time is average 1.1 seconds
        >
        > 2. run on my job PC (P4, 2.8Ghz)
        > echo |. time
        > ruby test\unit\orange_test.rb
        > echo |. time
        > --> time is average 5-6 seconds
        >
        > 3. run on windows virtualized in Parallels on my Intel Mac
        > echo |. time
        > ruby test\unit\orange_test.rb
        > echo |. time
        > --> time is average 3.5 seconds
        >
        > Running the same tests over and over, causes a lot of micro stress
        > for me.
        > I am unfortunate to do most of my work on that P4 2.8Ghz, but it
        > shouldn't be 5 times slower than my mac.
        >
        > Anyone with similar experience?
        > The chance for me to get a mac at work, is slim, since I work for an
        > insurance company. hehe.
        >
        > /Thomas
        >
        >
        >
        >
        >
        > UPCOMING MEETINGS:
        > September 27th 6-8pm UH POST 302 TBA
        > October 25th 6-8pm UH POST 302 TBA
        > November 29th 6-8pm UH POST 302 Java Cryptography Extension Eric Meyer
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
      • Thomas Olausson
        Yes, Seth has hinted me about the auto-test suite, which is to test what fastcgi is to cgis. But it s still kinda sucky it s that slow. Feels like I m back
        Message 3 of 10 , Jan 12, 2007
        View Source
        • 0 Attachment
          Yes, Seth has hinted me about the "auto-test" suite, which is to test what fastcgi is to cgis.

          But it's still kinda sucky it's that slow. Feels like I'm back doing java 1.0.

          /Thomas

          On Jan 12, 2007, at 1:29 PM, J. David Beutel wrote:

          I have no Ruby experience, but wonder if there's a Ruby shell that you
          could leave running to avoid the init overhead.

          Cheers,
          11011011

        • Seth Ladd
          Hi David, Good call. I d try out autotest. It runs continually and monitors for changes files. If it notices them, it will rerun that test. Should avoid
          Message 4 of 10 , Jan 12, 2007
          View Source
          • 0 Attachment
            Hi David,

            Good call.  I'd try out autotest.  It runs continually and monitors for changes files.  If it notices them, it will rerun that test.  Should avoid the hit of startup every time.

            On 1/12/07, J. David Beutel <jdb@...> wrote:

            I have no Ruby experience, but wonder if there's a Ruby shell that you
            could leave running to avoid the init overhead.

            Cheers,
            11011011

            Thomas Olausson <thomas.olausson@...> wrote on Friday, January 12,
            2007 12:20:03:


            > Any other rails developer with crawling test performance on Windows?
            >
            > When I run my rails unit tests, I've noticed that even though the
            > ruby unit test reports the time to run mosts simple tests is less
            > than a second,
            > in actuality, waiting for rails to init and to get the command prompt
            > back, is way more.
            >
            >
            > Check out these stats, I'm running a test case on three different
            > hardware
            > # ruby 1.8.5+rails 1.1.6 on both machines )
            > # test_helper initializes rails )
            > # a mysql instance is running on localhost, database.yml is pointing
            > to localhost )
            >
            > require File.dirname(__FILE__) + '/../test_helper'
            > class OrangeTest < Test::Unit::TestCase
            > def test_truth
            > p "dude"
            > assert true
            > end
            > end
            >
            > 1. run on my Intel Mac: (Dual Core 2ghz)
            > time ruby test/unit/orange_test.rb
            > --> time is average 1.1 seconds
            >
            > 2. run on my job PC (P4, 2.8Ghz)
            > echo |. time
            > ruby test\unit\orange_test.rb
            > echo |. time
            > --> time is average 5-6 seconds
            >
            > 3. run on windows virtualized in Parallels on my Intel Mac
            > echo |. time
            > ruby test\unit\orange_test.rb
            > echo |. time
            > --> time is average 3.5 seconds
            >
            > Running the same tests over and over, causes a lot of micro stress
            > for me.
            > I am unfortunate to do most of my work on that P4 2.8Ghz, but it
            > shouldn't be 5 times slower than my mac.
            >
            > Anyone with similar experience?
            > The chance for me to get a mac at work, is slim, since I work for an
            > insurance company. hehe.
            >
            > /Thomas
            >
            >
            >
            >
            >
            > UPCOMING MEETINGS:
            > September 27th 6-8pm UH POST 302 TBA
            > October 25th 6-8pm UH POST 302 TBA
            > November 29th 6-8pm UH POST 302 Java Cryptography Extension Eric Meyer
            >
            > Yahoo! Groups Links
            >
            >
            >
            >


          • Sam Joseph
            I haven t tried auto-test, but I just worked out I can run tests from the rails console: D: User Code ruby prometheus ruby script console test Loading test
            Message 5 of 10 , Apr 10 11:02 AM
            View Source
            • 0 Attachment
              I haven't tried auto-test, but I just worked out I can run tests from
              the rails console:

              D:\User\Code\ruby\prometheus>ruby script\console test
              Loading test environment.
              >> require 'test/unit/ui/console/testrunner'
              => true
              >> require 'test\unit\bookmark_test'
              D:/User/Code/ruby/prometheus/config/environment.rb:10: warning: already
              initialized constant RAILS_GEM_VERSION
              d:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:227:
              warning: already initialized constant Controllers
              => true
              >>
              ?> Test::Unit::UI::Console::TestRunner.run(BookmarkTest)
              Loaded suite BookmarkTest
              Started
              .
              TEST BENCHMARK REPORT
              0.125 test_truth(BookmarkTest)

              Finished in 0.141 seconds.

              1 tests, 1 assertions, 0 failures, 0 errors
              => #<Test::Unit::TestResult:0x598afc8 @channels={"CHANGED"=>{},
              "FAULT"=>{}}, @assertion_count=1, @errors=[], @failures=
              [], @run_count=1>
              >> Test::Unit::UI::Console::TestRunner.run(BookmarkTest)
              Loaded suite BookmarkTest
              Started
              .
              TEST BENCHMARK REPORT
              0.047 test_truth(BookmarkTest)

              Finished in 0.063 seconds.

              1 tests, 1 assertions, 0 failures, 0 errors
              => #<Test::Unit::TestResult:0x594faf0 @channels={"CHANGED"=>{},
              "FAULT"=>{}}, @assertion_count=1, @errors=[], @failures=
              [], @run_count=1>
              >>

              Has anyone been using autotest? I don't know that I'd want my tests to
              run on *every* save ...

              http://nubyonrails.com/articles/2006/04/19/autotest-rails

              CHEERS> SAM

              Seth Ladd wrote:
              > Hi David,
              >
              > Good call. I'd try out autotest. It runs continually and monitors
              > for changes files. If it notices them, it will rerun that test.
              > Should avoid the hit of startup every time.
              >
              > On 1/12/07, *J. David Beutel* <jdb@... <mailto:jdb@...>>
              > wrote:
              >
              > I have no Ruby experience, but wonder if there's a Ruby shell that
              > you
              > could leave running to avoid the init overhead.
              >
              > Cheers,
              > 11011011
              >
              > Thomas Olausson <thomas.olausson@...
              > <mailto:thomas.olausson%40gmail.com>> wrote on Friday, January 12,
              > 2007 12:20:03:
              >
              >
              > > Any other rails developer with crawling test performance on Windows?
              > >
              > > When I run my rails unit tests, I've noticed that even though the
              > > ruby unit test reports the time to run mosts simple tests is less
              > > than a second,
              > > in actuality, waiting for rails to init and to get the command
              > prompt
              > > back, is way more.
              > >
              > >
              > > Check out these stats, I'm running a test case on three different
              > > hardware
              > > # ruby 1.8.5+rails 1.1.6 on both machines )
              > > # test_helper initializes rails )
              > > # a mysql instance is running on localhost, database.yml is pointing
              > > to localhost )
              > >
              > > require File.dirname(__FILE__) + '/../test_helper'
              > > class OrangeTest < Test::Unit::TestCase
              > > def test_truth
              > > p "dude"
              > > assert true
              > > end
              > > end
              > >
              > > 1. run on my Intel Mac: (Dual Core 2ghz)
              > > time ruby test/unit/orange_test.rb
              > > --> time is average 1.1 seconds
              > >
              > > 2. run on my job PC (P4, 2.8Ghz)
              > > echo |. time
              > > ruby test\unit\orange_test.rb
              > > echo |. time
              > > --> time is average 5-6 seconds
              > >
              > > 3. run on windows virtualized in Parallels on my Intel Mac
              > > echo |. time
              > > ruby test\unit\orange_test.rb
              > > echo |. time
              > > --> time is average 3.5 seconds
              > >
              > > Running the same tests over and over, causes a lot of micro stress
              > > for me.
              > > I am unfortunate to do most of my work on that P4 2.8Ghz, but it
              > > shouldn't be 5 times slower than my mac.
              > >
              > > Anyone with similar experience?
              > > The chance for me to get a mac at work, is slim, since I work for an
              > > insurance company. hehe.
              > >
              > > /Thomas
              > >
              > >
              > >
              > >
              > >
              > > UPCOMING MEETINGS:
              > > September 27th 6-8pm UH POST 302 TBA
              > > October 25th 6-8pm UH POST 302 TBA
              > > November 29th 6-8pm UH POST 302 Java Cryptography Extension Eric
              > Meyer
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              > >
              >
              >
              >
            • dysinger
              I use it while I m coding sometimes. ... Windows? ... though the ... less ... different ... pointing ... stress ... work for an
              Message 6 of 10 , Apr 10 1:47 PM
              View Source
              • 0 Attachment
                I use it while I'm coding sometimes.

                --- In honolulu-coders@yahoogroups.com, Sam Joseph <srjoseph@...> wrote:
                >
                > I haven't tried auto-test, but I just worked out I can run tests from
                > the rails console:
                >
                > D:\User\Code\ruby\prometheus>ruby script\console test
                > Loading test environment.
                > >> require 'test/unit/ui/console/testrunner'
                > => true
                > >> require 'test\unit\bookmark_test'
                > D:/User/Code/ruby/prometheus/config/environment.rb:10: warning: already
                > initialized constant RAILS_GEM_VERSION
                > d:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:227:
                > warning: already initialized constant Controllers
                > => true
                > >>
                > ?> Test::Unit::UI::Console::TestRunner.run(BookmarkTest)
                > Loaded suite BookmarkTest
                > Started
                > .
                > TEST BENCHMARK REPORT
                > 0.125 test_truth(BookmarkTest)
                >
                > Finished in 0.141 seconds.
                >
                > 1 tests, 1 assertions, 0 failures, 0 errors
                > => #<Test::Unit::TestResult:0x598afc8 @channels={"CHANGED"=>{},
                > "FAULT"=>{}}, @assertion_count=1, @errors=[], @failures=
                > [], @run_count=1>
                > >> Test::Unit::UI::Console::TestRunner.run(BookmarkTest)
                > Loaded suite BookmarkTest
                > Started
                > .
                > TEST BENCHMARK REPORT
                > 0.047 test_truth(BookmarkTest)
                >
                > Finished in 0.063 seconds.
                >
                > 1 tests, 1 assertions, 0 failures, 0 errors
                > => #<Test::Unit::TestResult:0x594faf0 @channels={"CHANGED"=>{},
                > "FAULT"=>{}}, @assertion_count=1, @errors=[], @failures=
                > [], @run_count=1>
                > >>
                >
                > Has anyone been using autotest? I don't know that I'd want my tests to
                > run on *every* save ...
                >
                > http://nubyonrails.com/articles/2006/04/19/autotest-rails
                >
                > CHEERS> SAM
                >
                > Seth Ladd wrote:
                > > Hi David,
                > >
                > > Good call. I'd try out autotest. It runs continually and monitors
                > > for changes files. If it notices them, it will rerun that test.
                > > Should avoid the hit of startup every time.
                > >
                > > On 1/12/07, *J. David Beutel* <jdb@... <mailto:jdb@...>>
                > > wrote:
                > >
                > > I have no Ruby experience, but wonder if there's a Ruby shell that
                > > you
                > > could leave running to avoid the init overhead.
                > >
                > > Cheers,
                > > 11011011
                > >
                > > Thomas Olausson <thomas.olausson@...
                > > <mailto:thomas.olausson%40gmail.com>> wrote on Friday, January 12,
                > > 2007 12:20:03:
                > >
                > >
                > > > Any other rails developer with crawling test performance on
                Windows?
                > > >
                > > > When I run my rails unit tests, I've noticed that even
                though the
                > > > ruby unit test reports the time to run mosts simple tests is
                less
                > > > than a second,
                > > > in actuality, waiting for rails to init and to get the command
                > > prompt
                > > > back, is way more.
                > > >
                > > >
                > > > Check out these stats, I'm running a test case on three
                different
                > > > hardware
                > > > # ruby 1.8.5+rails 1.1.6 on both machines )
                > > > # test_helper initializes rails )
                > > > # a mysql instance is running on localhost, database.yml is
                pointing
                > > > to localhost )
                > > >
                > > > require File.dirname(__FILE__) + '/../test_helper'
                > > > class OrangeTest < Test::Unit::TestCase
                > > > def test_truth
                > > > p "dude"
                > > > assert true
                > > > end
                > > > end
                > > >
                > > > 1. run on my Intel Mac: (Dual Core 2ghz)
                > > > time ruby test/unit/orange_test.rb
                > > > --> time is average 1.1 seconds
                > > >
                > > > 2. run on my job PC (P4, 2.8Ghz)
                > > > echo |. time
                > > > ruby test\unit\orange_test.rb
                > > > echo |. time
                > > > --> time is average 5-6 seconds
                > > >
                > > > 3. run on windows virtualized in Parallels on my Intel Mac
                > > > echo |. time
                > > > ruby test\unit\orange_test.rb
                > > > echo |. time
                > > > --> time is average 3.5 seconds
                > > >
                > > > Running the same tests over and over, causes a lot of micro
                stress
                > > > for me.
                > > > I am unfortunate to do most of my work on that P4 2.8Ghz, but it
                > > > shouldn't be 5 times slower than my mac.
                > > >
                > > > Anyone with similar experience?
                > > > The chance for me to get a mac at work, is slim, since I
                work for an
                > > > insurance company. hehe.
                > > >
                > > > /Thomas
                > > >
                > > >
                > > >
                > > >
                > > >
                > > > UPCOMING MEETINGS:
                > > > September 27th 6-8pm UH POST 302 TBA
                > > > October 25th 6-8pm UH POST 302 TBA
                > > > November 29th 6-8pm UH POST 302 Java Cryptography Extension Eric
                > > Meyer
                > > >
                > > > Yahoo! Groups Links
                > > >
                > > >
                > > >
                > > >
                > >
                > >
                > >
                >
              • Thomas Olausson
                I ve used it too, It triggers on saves. When you do save, auto-test shells out ruby test unit some_test.rb The startup of that shell out is still slow, and I
                Message 7 of 10 , Apr 10 9:41 PM
                View Source
                • 0 Attachment
                  I've used it too, 
                  It triggers on saves. When you do save, auto-test shells out
                  ruby test\unit\some_test.rb

                  The startup of that shell out is still slow, and I tend to switch over to the test window to see how it's going.
                  Don't save much time really.
                  I also tend to run unit tests in units. I test one method at a time, not 15.

                  Yes, I'm saying you should get a Mac. :) Rails starts much faster on OSX.

                  /Thomas

                  On Apr 10, 2007, at 10:47 AM, dysinger wrote:

                  I use it while I'm coding sometimes.

                  --- In honolulu-coders@yahoogroups.com, Sam Joseph <srjoseph@...> wrote:
                  >
                  > I haven't tried auto-test, but I just worked out I can run tests from
                  > the rails console:

                • Sam Joseph
                  Hmm, autotest failed out of the box in my Rails 1.0 environment today. I think with a little script work, my approach of running in the console could be pretty
                  Message 8 of 10 , Apr 10 9:59 PM
                  View Source
                  • 0 Attachment
                    Hmm, autotest failed out of the box in my Rails 1.0 environment today.

                    I think with a little script work, my approach of running in the console
                    could be pretty speedy - I was enjoying its extreme speed today, but I
                    always hate that I lose the history when I kill the console.

                    A little something to check for changes and reload from within console
                    could be the best of both worlds - although I too crave testing one
                    method at a time - if I can't get that I can't use a test framework ...

                    CHEERS> SAM

                    Thomas Olausson wrote:
                    > I've used it too,
                    > It triggers on saves. When you do save, auto-test shells out
                    > ruby test\unit\some_test.rb
                    >
                    > The startup of that shell out is still slow, and I tend to switch over
                    > to the test window to see how it's going.
                    > Don't save much time really.
                    > I also tend to run unit tests in units. I test one method at a time,
                    > not 15.
                    >
                    > Yes, I'm saying you should get a Mac. :) Rails starts much faster on OSX.
                    >
                    > /Thomas
                    >
                    > On Apr 10, 2007, at 10:47 AM, dysinger wrote:
                    >
                    >> I use it while I'm coding sometimes.
                    >>
                    >> --- In honolulu-coders@yahoogroups.com
                    >> <mailto:honolulu-coders%40yahoogroups.com>, Sam Joseph <srjoseph@...>
                    >> wrote:
                    >> >
                    >> > I haven't tried auto-test, but I just worked out I can run tests from
                    >> > the rails console:
                    >>
                    >
                  • dysinger
                    Rails 1.0 is pretty old. I would upgrade if you can. Latest is 1.2.3 ... console ... over ... on OSX. ... tests from
                    Message 9 of 10 , Apr 11 1:27 AM
                    View Source
                    • 0 Attachment
                      Rails 1.0 is pretty old. I would upgrade if you can. Latest is 1.2.3

                      --- In honolulu-coders@yahoogroups.com, Sam Joseph <srjoseph@...> wrote:
                      >
                      > Hmm, autotest failed out of the box in my Rails 1.0 environment today.
                      >
                      > I think with a little script work, my approach of running in the
                      console
                      > could be pretty speedy - I was enjoying its extreme speed today, but I
                      > always hate that I lose the history when I kill the console.
                      >
                      > A little something to check for changes and reload from within console
                      > could be the best of both worlds - although I too crave testing one
                      > method at a time - if I can't get that I can't use a test framework ...
                      >
                      > CHEERS> SAM
                      >
                      > Thomas Olausson wrote:
                      > > I've used it too,
                      > > It triggers on saves. When you do save, auto-test shells out
                      > > ruby test\unit\some_test.rb
                      > >
                      > > The startup of that shell out is still slow, and I tend to switch
                      over
                      > > to the test window to see how it's going.
                      > > Don't save much time really.
                      > > I also tend to run unit tests in units. I test one method at a time,
                      > > not 15.
                      > >
                      > > Yes, I'm saying you should get a Mac. :) Rails starts much faster
                      on OSX.
                      > >
                      > > /Thomas
                      > >
                      > > On Apr 10, 2007, at 10:47 AM, dysinger wrote:
                      > >
                      > >> I use it while I'm coding sometimes.
                      > >>
                      > >> --- In honolulu-coders@yahoogroups.com
                      > >> <mailto:honolulu-coders%40yahoogroups.com>, Sam Joseph <srjoseph@>
                      > >> wrote:
                      > >> >
                      > >> > I haven't tried auto-test, but I just worked out I can run
                      tests from
                      > >> > the rails console:
                      > >>
                      > >
                      >
                    • Sam Joseph
                      ... Works pretty damn good though ... I would like to - however it is difficult for one particular project I have ... I know - I have several projects that use
                      Message 10 of 10 , Apr 11 8:31 AM
                      View Source
                      • 0 Attachment
                        dysinger wrote:
                        > Rails 1.0 is pretty old.
                        Works pretty damn good though
                        > I would upgrade if you can.
                        I would like to - however it is difficult for one particular project I have
                        > Latest is 1.2.3
                        >
                        I know - I have several projects that use it.

                        CHEERS> SAM
                      Your message has been successfully submitted and would be delivered to recipients shortly.