Question

I have a pretty large rails app (Rails 3.2.3), using the asset pipeline. There are are quite a few files in the assets folder.

Under 1.8.7, running rake assets:precompile takes 4 minutes. This is long, but due to the sheer number of assets I'm willing to tolerate it.

The problem is that after upgrading the app to 1.9.2, running rake assets:precompile takes 28 minutes.

Here are the relevant gem versions:

rails (= 3.2.3)
uglifier (1.2.3)
  execjs (~> 1.3.0)
therubyracer (~> 0.9.9)
  libv8 (~> 3.3.10)
sprockets (2.1.2)
  hike (~> 1.2)
  rack (~> 1.0)
  tilt (~> 1.1, != 1.3.0)

When I tail -f log/production.log I see the assets being compiled, and I can't pinpoint the long delay to a single asset (though it does seem like I see the same assets multiple times in the logs -- presumably because there are multiple steps for each asset?)

What other steps should I try to help diagnose what the issue is?

Was it helpful?

Solution

Ruby 1.9.2 had severe regressions in load time, which I believe grew exponentially with the number of files loaded. This hit Rails apps really hard, and I suspect it's the cause behind the greatly increased asset compilation time you're seeing.

This has been fixed in 1.9.3, so try upgrading to that or backporting the load patch to 1.9.2.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top