I noticed the boot time for the application was very slow. Here are the actions and steps I took to decrease it.
The first think I needed to do was benchmark how long each bit of code took to be required by the application. I used a script I found on Google to help.
Combining and adding all the require times together you can see that it take almost a minute to load everything.
$ ruby AddTimes_0.rb
57.22181100000005
$ vagrant ssh -c "cd /vagrant; time rails console"
real 0m46.279s
user 0m5.752s
sys 0m3.324s
$ vagrant ssh -c "cd /vagrant; time rspec spec"
# Number of Requires
654
** Remove requires out of application.rb
**
Commit SHA:
$ ruby AddTimes_1.rb
2.870594000000001
$ vagrant ssh -c "cd /vagrant; time rails console"
real 0m25.483s
user 0m6.724s
sys 0m2.220s
$ vagrant ssh -c "cd /vagrant; time rspec spec"
# Number of Requires
311
I love you Chuck!