In deciding on a proper MAc Pro config, I am considering whether it would be worth the money to spring for the Xeon quad configuration? However, is Ruby able to tap into the parallel processing abilities of a multi-core processor? Would it make a difference versus the single core into terms of performance?
-
Certainly if you had a cluster setup you'd definitely see performance gains (assuming CPU bound operations). – Candide Nov 02 '11 at 00:16
-
1Can you even get a single-core Mac Pro? – Dave Newton Nov 02 '11 at 00:19
-
Have you read http://stackoverflow.com/q/7493053/38765 and http://stackoverflow.com/questions/56087/does-ruby-have-real-multithreading ? – Andrew Grimm Nov 02 '11 at 00:55
2 Answers
Ruby can, to some extent, take advantage of multiple cores by Thread.new { ... }
, but what other people have said about Rails apps on the dev machine needing multi-core is pretty accurate - it's not necessary. While you can use JRuby to get multi-threaded Ruby in production, it's not going to make much difference on your dev box, especially since you'll likely have caching turned off on your dev machine, etc., which is going to affect performance a lot more than throwing more hardware at the problem. What using JRuby locally will do (if you're also using it production) is warn of JRuby-specific issues that you might not otherwise see until you try to deploy.
All that being said, I find a solid, powerful machine very useful for all the things I do around development:
- Playing music for concentration
- Running PostgreSQL/MySQL test server locally for testing
- Possible VMWare Fusion/Parallels with a test server running locally
- Having a browser with tons of open tabs running for testing/documentation lookup/asking questions on StackOverflow
- You'll want your Terminal open pretty much all the time
- Your text editor
...and on and on, depending on what your setup is. Everyone is different, but I think it's safe to say that you're going to have several things running most of the time regardless.
The really awesome thing about a good, powerful machine is going to be having a super responsive system with all the things you'll wind up doing while coding, so you don't feel like your dev box is slowing you down. Personally, it's the last thing I want to think about.
As recently as 6 months ago I was doing Rails development on a 5-year-old 13" macbook containing one of the first Core 2 Duo chips, and really it was totally fine. I could get my work done, and the machine did what I needed it to do. However, I finally got an upgrade to a new machine (Core i7 processor and tons of RAM), and the major difference I noticed was how snappy the machine is. No, the faster machine doesn't make me type faster, and my test suite doesn't run much faster than it did before (believe it or not) but the extra computational room that I get makes coding way more comfortable.
There's also the argument that, if you code for a living, the price of a comfortable machine as a % of your salary is usually quite small, and goes a long way toward giving you a great environment for creative work.

- 33,527
- 7
- 88
- 126
-
Thank you for your answer. Do you run VMWare for cross-brower compatibility tests? (just curious) – N G Nov 02 '11 at 01:03
-
That's part of it. I also use it to run test servers that stand-in for production servers in my dev environment. For example, we have an app that has a local app database, but also relies on a CAS server for user authentication across the enterprise. Rather than have my dev machine hit the actual CAS server during development, folks on my team have a VM locally that runs a test CAS server. That's kind of an extreme example, but in our case, it's the simplest way to most closely replicate production, while in development, and therefore avoid unwanted surprises when deploying. – jefflunt Nov 02 '11 at 01:09
-
1In these cases, RAM still probably matters most to how responsive your system is. If you have to make a RAM vs. CPU decision due to budget restrictions I would go with more RAM. But if you can do both, it will be worth it. – jefflunt Nov 02 '11 at 01:10
Your app probably isn't going to be multithreaded, but that doesn't matter anyway — even if it was, your app probably isn't going to be cpu-hungry enough for it to make a difference on your dev machine.
What makes a difference is all the other stuff that you do while developing — loading the app into ram, running script, running tests...
More cores are always nice and will help you do the above stuff and more in parallel a little faster here and there, but where you are going to see the bigger performance boost is:
- SSD
- ram
Spend money on an SSD and ram, in that order, before spending money on CPU.

- 22,495
- 29
- 154
- 227
-
I thought so, but I didn't dare mention SSD or RAM, as the question could have been deemed too subjective (we all know where that leads...;) – N G Nov 02 '11 at 01:04