4

I've been developing Ruby on Rails on my Macbook Pro for quite some time, but recently I'm starting to notice, that everything is just taking forever.

Even simple things like rake -T take over 30 seconds to complete.

$ time rake -T
real    0m35.113s
user    0m12.997s
sys     0m1.828s

When I do the same thing on my VPS, which has much less memory and CPU available, it runs about three times as fast. I'm using Ruby 1.9.2 installed via RVM on OS X Lion.

Is there anything that I can check/do to get some instant improvement? I was thinking about upgrading to SDD, but I don't want to make such a decision too early.

Crashworks
  • 40,496
  • 12
  • 101
  • 170
Jakub Arnold
  • 85,596
  • 89
  • 230
  • 327
  • Have you tried seeing how long it takes to do `rake -T` in an empty Rails application? How about seeing how long it takes for ruby to run a script that has no dependencies and just prints "hello world"? – Andrew Grimm Nov 23 '11 at 22:36
  • Check your memory usage. Long running ruby/rails processes can gobble up a lot of memory, slowing everything down. Restarting typically helps. Also if you have a large rails environment, it can take a substantial time on the initial load. – Doug R Nov 23 '11 at 22:41
  • What if you switch to system Ruby, is that slow too? Have you tried imploding RVM and starting from scratch? – Michael Kohl Nov 23 '11 at 22:42

1 Answers1

1

It could be some gem's fault, perhaps one that adds a lot of middleware.

This might help you.

Also, please try installing 1.9.3, it should perform better at loading.

Edit

Just wanted to add that, if all else fails, [the Mac counterpart of] good ole strace could be of some help.

Community
  • 1
  • 1
s.m.
  • 7,895
  • 2
  • 38
  • 46