Speeds up your Rails3 rake assets:precompile

Posted

turbo-sprockets-rails3加入到Gemfile中

```ruby Gemfile group :assets do ... gem 'turbo-sprockets-rails3' end

然后
```sh
bundle install

###下面是速度调试对比

*加之前

$ time RAILS_ENV=production bundle exec rake assets:precompile
/Users/xxx/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /Users/john/.rvm/gems/ruby-1.9.3-p125@3.9/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

real    1m45.970s
user    1m35.596s
sys 0m5.559s

*加入之后

$ time RAILS_ENV=production bundle exec rake assets:precompile
/Users/xxx/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /Users/john/.rvm/gems/ruby-1.9.3-p125@3.9/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
real    0m56.796s
user    0m50.407s
sys 0m3.604s

参考:https://github.com/ndbroadbent/turbo-sprockets-rails3


此文章 短链接: http://dlj.bz/jgjv5y