If you are using the asset pipeline in rails 3.1 or 3.2 to compile and minify your js and css, you may observe that it is crazy slow.  On an SPA-style app I am contributing to, it was taking over an hour on my macbook air (cpu-bound).  The problem ultimately is that the javascript runtime available to ruby under java (rhino) is slow.  While you may think 'oh, well i'll just precompile assets under c-ruby'.. this is a nice thought, but then you would have to swap your gemfile and .bundler directories and change your ruby platform every time you just wanted to precompile your assets.  I did go through this excersize to confirm that it was an issue with jruby/rhino and not a code issue, and while it went much faster, the added complexity was not worth it.

The solution to fast asset compilation under jruby is to use node as your js engine.

Since everyone in this shop uses *nix-like operating systems, slipping this into production.rb worked just fine: 

if defined?(ExecJS) && system('which node')
      puts "Using Node ExecJS runtime"
      ExecJS.runtime = ExecJS::Runtimes::Node
    end

This will do a rudimentary check to ensure that node is available and if it is, will setup ExecJS to use it as the runtime.  It will only attempt any of this if ExecJS is loaded.

This made our asset precompilation time go from about 79 minutes to 5 minutes.  Under c-ruby/v8 it takes about 3 minutes.  So, still not awesome but 'good enough'.