Rake Test Very Slow in Windows

Rake Test Very Slow in Windows

In general Ruby's MRI interpreter is just not optimized for speed on windows. You might also be running it in development mode on windows vs production mode on the other machines. Rails runs much slower in development mode since it reloads all your classes on every request.

1.8.6 is a very old ruby version. Released almost 3 years ago. You should strongly consider upgrading to 1.9 (or at least 1.8.7). Or switching to JRuby. All of these options will likely lead to a significant performance improvement.

1.8.7 should be fully compatible with 1.8.6. 1.9 has a completely new interpreter that runs 2.5 times faster (Though it has a tendency to occasionally crash on windows). JRuby may be the ideal solution for you since you can run it in either compatibility for 1.8 or 1.9 and it is very stable, but it does not support gems with C extensions and requires a different database adapter.

One last option would be to try running Rails inside of a VMWare with CentOS or another Linux distribution.

Rake tests running very slow

Your problem is Windows. We use JRuby on Windows and it actually runs faster than RubyInstaller(mingw) ruby on Windows but we do see very slow results when running test suites or starting a rails server. About 1 minute for a single test run due to the loading of the Rails environment.
You have a few options:

  1. Switch to linux / osx
  2. Use spork to keep a couple rails environments pre-loaded for your tests. Note that this isn't perfect but it will reduce your times substantially. With this option you'll probably want to use minitest or rspec, I had trouble getting spork to work on Windows with testunit. With spork you should be able to get your single test run time down to about 10 seconds.
  3. Write as many of your tests to run outside of Rails, in other words to not require the Rails stack. This will be very fast, you should be able to run a test in only a few seconds but as you could guess, it's hard to test a lot of things (controllers, views) outside of rails. Works perfectly though for functions you've broken out into modules that already do not require anything from rails.

Good luck!

Rake Test Very Slow in Windows

In general Ruby's MRI interpreter is just not optimized for speed on windows. You might also be running it in development mode on windows vs production mode on the other machines. Rails runs much slower in development mode since it reloads all your classes on every request.

1.8.6 is a very old ruby version. Released almost 3 years ago. You should strongly consider upgrading to 1.9 (or at least 1.8.7). Or switching to JRuby. All of these options will likely lead to a significant performance improvement.

1.8.7 should be fully compatible with 1.8.6. 1.9 has a completely new interpreter that runs 2.5 times faster (Though it has a tendency to occasionally crash on windows). JRuby may be the ideal solution for you since you can run it in either compatibility for 1.8 or 1.9 and it is very stable, but it does not support gems with C extensions and requires a different database adapter.

One last option would be to try running Rails inside of a VMWare with CentOS or another Linux distribution.

Rails rake: test are slow

I do most of my ruby development in an Ubuntu VM, just because it is easier to get everything together under linux (I imagine the same applies to OSX). RVM makes my life so much easier.

If your hardware can support it and you don't mind working in a VM, may I suggest you give it a try? VM development has its advantages (namely, taking daily snapshots so you can roll back environment changes) and disadvantages (you lose a bit of speed, but not much these days) but I think it is worth it overall.

Rails rake: test are slow

I do most of my ruby development in an Ubuntu VM, just because it is easier to get everything together under linux (I imagine the same applies to OSX). RVM makes my life so much easier.

If your hardware can support it and you don't mind working in a VM, may I suggest you give it a try? VM development has its advantages (namely, taking daily snapshots so you can roll back environment changes) and disadvantages (you lose a bit of speed, but not much these days) but I think it is worth it overall.

rspec tests under jruby on Windows running very slow

It is not loading RSpec, but it is JVM startup time you are feeling.

See https://github.com/jruby/jruby/wiki/Improving-startup-time for more information.

Why is RSpec so slow under Rails?

You should be able to to speed up your script/spec calls by running script/spec_server in a separate terminal window, then adding the additional -X parameter to your spec calls.



Related Topics



Leave a reply



Submit