ndbroadbent / turbo-sprockets-rails3

Speeds up your Rails 3 assets:precompile by only recompiling changed files, and only compiling once to generate all assets
MIT License
975 stars 78 forks source link

Rails 4 ? #61

Closed kristianmandrup closed 11 years ago

kristianmandrup commented 11 years ago

turbo-sprockets-rails4 ???

ndbroadbent commented 11 years ago

Hi there, turbo-sprockets-rails3 was created to solve a problem with the Rails 3 asset pipeline. These problems have all been solved in Rails 4, so the gem will not be necessary. Thanks :)

maletor commented 11 years ago

@ndbroadbent, can you elaborate on how this problem has been solved in Rails 4? Do you mean by virtue of sprockets not being packaged with Rails anymore?

ndbroadbent commented 11 years ago

Hi @maletor,

The main reason is that non-digest assets are no longer being compiled, so the assets cache is not cleared between runs. This also means that the cache can be re-used between environments, such as development and production. So if you are developing on your local machine, and then run assets:precompile, it will finish almost instantly.

I think the heroku buildpack might still need to be tweaked so that it stores and reuses the assets cache between pushes, but that's a different issue.

canweriotnow commented 11 years ago

Really?

Rails 4.0.0, Ruby 2.0.0-p247:

$ time rake assets:precompile
...
real 17m41.451s 
user 14m42.228s 
sys 0m4.088s
rymohr commented 11 years ago

@canweriotnow how about if you run it again?

canweriotnow commented 11 years ago

I'm on a newer machine, now between 5-8 min. on rake assets:precompile. CSS seems to take th longest (previously I was operating on a theroy of multiple jQuery compilations), I think it might be the Less engine from twitter-bootstrap-rails, going to try switching out to the sass-ified bootstrap gem and see if that helps.

thbar commented 9 years ago

@canweriotnow just saw your comment - did your switch accelerate the precompile time? Thanks!

camertron commented 7 years ago

We upgraded our app to Rails 4 last year and were pretty disappointed at how slow asset precompilation was, especially considering the speed and caching issues were supposed to have been solved. We ended up writing some code to precompile assets in parallel, which sped up precomp by quite a bit. I just extracted and published the code as turbo-sprockets-rails4, which is available here. Your mileage may vary 😉