Skip to content

Instantly share code, notes, and snippets.

@SamSaffron
Last active May 24, 2016 00:09
Show Gist options
  • Save SamSaffron/4f6fec9be5d1e94d13458b494db08f69 to your computer and use it in GitHub Desktop.
Save SamSaffron/4f6fec9be5d1e94d13458b494db08f69 to your computer and use it in GitHub Desktop.

MiniRacer https://github.com/discourse/mini_racer is ready for testing.

Can you help out measuring how it improves performance for rake assets:precompile in your app?

  • Run:
rm -fr public/assets
RAILS_ENV=production time bundle exec rake assets:precompile
  • Edit Gemfile. Remove therubyracer, add:
gem 'execjs', github: 'rails/execjs'
gem 'mini_racer'
  • bundle install

  • Run:

rm -fr public/assets
RAILS_ENV=production time bundle exec rake assets:precompile
@nickbrowne
Copy link

Are you guys deleting the sprockets cache (tmp/assets) between runs? I got several times speed up at first too but then after doing that the speed up was reduced to 25% (still good, but not as unbelievable as I first thought).

I've been using assets:clobber

@JanDintel
Copy link

Results after running rm -rf public/assets tmp/cache/assets before runs:

therubyracer:
67.42s user 3.39s system 95% cpu 1:14.36 total

mini_racer:
55.45s user 3.28s system 97% cpu 59.960 total

@rbishop
Copy link

rbishop commented May 24, 2016

Cleared caches and made sure spring wasn't running. Results:

therubyracer: 3m50s user
mini_racer: 1m48s user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment