<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ruby on Random Musings</title><link>https://chengl.com/tags/ruby/</link><description>Recent content in Ruby on Random Musings</description><generator>Hugo</generator><language>en-us</language><copyright>Cheng Long</copyright><lastBuildDate>Sun, 30 Jul 2017 09:22:27 +0000</lastBuildDate><atom:link href="https://chengl.com/tags/ruby/index.xml" rel="self" type="application/rss+xml"/><item><title>Ruby and Java Stack Level</title><link>https://chengl.com/post/ruby-and-java-stack-level/</link><pubDate>Sat, 05 Nov 2016 09:17:00 +0000</pubDate><guid>https://chengl.com/post/ruby-and-java-stack-level/</guid><description>&lt;p&gt;While coding for an algorithmic problem, I discovered that Ruby&amp;rsquo;s stack level is much shallower than Java. This caused a recursive DFS solution written in Ruby failed due to &lt;code&gt;stack level too deep (SystemStackError)&lt;/code&gt;, 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.&lt;/p&gt;</description></item><item><title>Speed up bundle install</title><link>https://chengl.com/post/speed-up-bundle-install/</link><pubDate>Sat, 04 Apr 2015 08:36:00 +0000</pubDate><guid>https://chengl.com/post/speed-up-bundle-install/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Next time, when you need &lt;code&gt;bundle install&lt;/code&gt;, do &lt;code&gt;bundle install --jobs X&lt;/code&gt;, where &lt;strong&gt;X&lt;/strong&gt; is the number of your machine cores. It will save you huge amount of time.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://archlever.blogspot.sg/2013/09/lies-damned-lies-and-truths-backed-by.html"&gt;Some blog&lt;/a&gt; suggests that setting the number of jobs to &lt;strong&gt;X-1&lt;/strong&gt; is statistically better than &lt;strong&gt;X&lt;/strong&gt;. But that is not true anymore, at least with bundler &amp;gt;= 1.7.12. To prove this, I tested it on a large Rails project (&lt;a href="https://github.com/discourse/discourse"&gt;discourse&lt;/a&gt;) on my Mid 2012 MBP with 2.6 GHz Intel Core i7. Below is my test result:&lt;/p&gt;</description></item></channel></rss>