Skip to content

Instantly share code, notes, and snippets.

@mattscilipoti
Last active April 20, 2016 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattscilipoti/a0b141458152c3998671565269ed1b6d to your computer and use it in GitHub Desktop.
Save mattscilipoti/a0b141458152c3998671565269ed1b6d to your computer and use it in GitHub Desktop.
Faster Rails Load Times

Faster load times? (circa 2011)

  • Benchmark with:

        $ time script/rails runner "puts 1"
  • Dropped from 18 to 13s using :require => false judiciously in Gemfile.

  • (outdated with ruby 2.3, I think) Dropped from 13 to 8.5s using patched ruby:

    $ curl https://raw.github.com/gist/1008945/4edd1e1dcc1f0db52d4816843a9d1e6b60661122/ruby-1.9.2p290.patch > /tmp/require-performance-fix.patch
    $ rvm install ruby-1.9.2-p290 --patch /tmp/require-performance-fix.patch -n patch_require
    $ cd karma # use `cd .. && cd -` if you are already in the project dir
    • You should see: Using /Users/<you>/.rvm/gems/ruby-1.9.2-p290-patch_require with gemset coed_naked_planning

References:

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