Ruby and Java Stack Level

While coding for an algorithmic problem, I discovered that Ruby’s stack level is much shallower than Java. This caused a recursive DFS solution written in Ruby failed due to stack level too deep (SystemStackError), while the same code written in Java passed. Whether recursion or tail recursion should be used is not the point of this post. This post is to find out what the max stack level is and what limits the stack level.

»

Speed up bundle install

TL;DR Next time, when you need bundle install, do bundle install --jobs X, where X is the number of your machine cores. It will save you huge amount of time.

Some blog suggests that setting the number of jobs to X-1 is statistically better than X. But that is not true anymore, at least with bundler >= 1.7.12. To prove this, I tested it on a large Rails project (discourse) on my Mid 2012 MBP with 2.6 GHz Intel Core i7. Below is my test result:

»