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
@jdowning
Copy link

Rails 4.1.15

using nodejs 4.0.0
76.85s user 19.09s system 86% cpu 1:51.19 total

using mini_racer
14.65s user 6.44s system 68% cpu 30.843 total

🎉

@ibrahima
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).

@clupprich
Copy link

Before (therubracer)
21.35s user 6.19s system 96% cpu 28.639 total

After (mini_racer)
4.67s user 1.82s system 84% cpu 7.663 total

@jmbejar
Copy link

jmbejar commented May 17, 2016

Running in a small Rails 5 application (ruby 2.3.1p112) the command:
time RAILS_ENV=production bundle exec rake assets:precompile
(after running rm -rf public/assets tmp/cache/assets)

therubyracer
30.90s user 0.91s system 100% cpu 31.744 total

system node (v4.4.4)
13.35s user 0.99s system 103% cpu 13.913 total

mini_racer
12.33s user 1.02s system 103% cpu 12.858 total

@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