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

Speed up touching, make shell escaping more robust. #48

Closed oggy closed 11 years ago

oggy commented 11 years ago

1.

Shellwords is part of the ruby stdlib, and built for proper shell escaping.

2.

The touch command can receive multiple files, and can even ignore nonexistent files with the POSIX-compliant -c option. Doing 1000 files per invocation dramatically sped up this phase of precompilation for me. On an app with just under 7k files under public/assets:

Before:

$ bundle exec rake RAILS_ENV=development RAILS_GROUPS=assets assets:precompile touching (nil): 88.8947s compiling (nil): 70.7533s touching (false): 0.0000s generating (false): 6.5764s

After:

$ bundle exec rake RAILS_ENV=development RAILS_GROUPS=assets assets:precompile touching (nil): 0.9903s compiling (nil): 68.2418s touching (false): 0.0000s generating (false): 6.4802s

ndbroadbent commented 11 years ago

Awesome, thanks!! I've released 0.3.5 with your change.