Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7661649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:37:34+00:00 2026-05-31T13:37:34+00:00

In my dev sandbox RAILS_ENV=production rake assets:precompile is taking over 4 minutes to complete.

  • 0

In my dev sandbox

RAILS_ENV=production rake assets:precompile

is taking over 4 minutes to complete. Is this normal. On heroku it is taking over 10 minutes to do the job and sometimes is timing out. Is there any way to disect this and/or speed it up?

UPDATE

I profiled the CSS vs JS phases of compilation

3.7 s        js
175 s            css

The numbers were made by instrumenting here

----------------------
/Users/bradphelan/.rvm/gems/ruby-1.9.2-p180@gobbq/gems/sprockets-2.1.2/lib/sprockets/processing.rb
----------------------
266     # Assign a compressor to run on `application/javascript` assets.
267     #
268     # The compressor object must respond to `compress` or `compile`.
269     def js_compressor=(compressor)
270       expire_index!
271  
272       unregister_bundle_processor 'application/javascript', :js_compressor
273       return unless compressor
274  
275       register_bundle_processor 'application/javascript', :js_compressor do |context, data|
276  
277         timeit "js" do
278           compressor.compress(data)
279         end
280  
281       end
282     end

and

    ----------------------
    /Users/bradphelan/.rvm/gems/ruby-1.9.2-p180@gobbq/gems/sprockets-2.1.2/lib/sprockets/processing.rb
    ----------------------
    241  
    242     # Assign a compressor to run on `text/css` assets.
    243     #
    244     # The compressor object must respond to `compress` or `compile`.
    245     def css_compressor=(compressor)
    246       expire_index!
    247  
    248       unregister_bundle_processor 'text/css', :css_compressor
    249       return unless compressor
    250  
    251       register_bundle_processor 'text/css', :css_compressor do |context, data|
    252         timeit "css" do
    253           compressor.compress(data)
    254         end
    255       end
    256     end

The timeit call is the added bit doing the timing

def timeit context
  s = Time.now
  yield.tap do 
    e = Time.now
    d = e - s
    puts "#{d*1000}\t #{context}"
  end
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:37:35+00:00Added an answer on May 31, 2026 at 1:37 pm

    The hackety hack solution seems to be to monkey patch the standard sass compression engine out of the way. I added this to the top of my application.rb

    module Sass
      module Rails
        class CssCompressor
          def compress(css)
            css
          end
        end
      end
    end
    

    The difference in file size was 124k before the monkey patch and 125k after and an order of magnitude speed improvement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found the console and run it like this: root@valugi-laptop:/var/www/sandbox/hello# php console Symfony version
http://dev.epicwebdesign.ca/emco/assets/mapping.php That's loaded as an iFrame in http://dev.epicwebdesign.ca/emco/?page=dealerlocator . For some reason, the map
The dev version of Netbeans has Git support. This is great. I'm not sure
http://dev.sencha.com/deploy/dev/examples/button/buttons.html I saw this and was wondering if I have access to these kind
http://dev.viral-minds.com/miller/abc/abc.html two questions about this How do I keep the green block from blinking
. Dear Dev Guys :) I'm learning ASP.NET MVC3 and I'm stuck when I
Our dev server was recently upgraded to PHP v5.2.13. With that upgrade we have
My dev machine is 32 bit, and my target is a 64 bit web
Beginner iOS dev here. I have a problem in my array. Im making an
I've got a dev server on localhost, a test server on a dedicated server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.