Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 361 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rails on Windows is so slow (rails -v takes 4 seconds)

#1
I'm using rails Version 3.0.3 and ruby Version 1.9.2p136 (2010-12-15) on a Intel Core 2 Duo 2,6 Ghz with 4 GB Ram and Windows Vista Business SP2 with no other (heavy) applications running. I have already read that rails development on Windows is slower than on Unices and most people do there for not recommend it but this is silly.

I can't think of any good reason for using 4 seconds to display a simple Version number. And rails generate needs up to 10 seconds to complete!

Something in my setup must be wrong (at least I hope).

Has someone a good idea how to proceed? Thanks in advance!
Reply

#2
you can try playing with ruby's garbage collecter to make ruby faster, since the defaults variable settings don't match how windows work


also [Garbage collector performance tuning][2]


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#3
It is faster to use Ruby inside an Ubuntu Virtual Machine than using it directly with Windows.

A good option is to use Vagrant: You develop on your Windows IDE, and files are "shared" with the Ubuntu VM, you run "vagrant ssh", then run "rails server", or any other command you'd like to run. There are other benefits as well:

* Your don't need to install RVM, or switch ruby versions, just use a VM for each project. VMs can be small, like 500MB of data, using up to 100MB of RAM, but YMMV
* You don't need to worry about gem's compatibility with Windows

Take a look:

[To see links please register here]

Reply

#4
For a speedup you could try my loader speeder upper (helps rails run faster in Windows):

[To see links please register here]


Also checkout spork, which works in Windows, and jruby also works well.
Reply

#5
There are a few key points that combined generate the slow performance you're noticing.

* Ruby IO performance (on any version) is up to 3 times slower than Linux counterparts. This is because several unoptimized hops in the Windows codebase of Ruby. This requires further analysis, investigation and optimization not done until today.
* Ruby 1.9.2 produces several `stat()` calls per file been required, which can increase the slowdown of Ruby itself. This is not present in Ruby 1.8.6 or 1.8.7. This is also solved in Ruby 1.9.3 (trunk) not released yet.
* Projects like Rails requires around 500 files, which combined with above points make Ruby for Windows the snail lot of folks see.

Now, there are workaround to that, some simple and some complex ones.

1. Move back to Ruby 1.8.7 instead of Ruby 1.9.2. That will bring again certain level of speed to your application. Unless you're taking advantage of Unicode support, then 1.8.7 could work for you.
2. Look into tools like Spork to provide scenario/forking for your RSpec/Cucumber
3. Move your development to RAM, using a RAMDisk like [ImDisk][1]. Move both Ruby and your application to it and time of loading will be reduced (this is associated with your available RAM too)

Hope some of these options help you.

[1]:

[To see links please register here]

Reply

#6
More than likely, it's anti-virus affecting it. That combined with Vista's speed issues are probably affecting it. I agree with Justice, run Linux in a VM.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through