I finally found my launch bottlenecks using Benchmark. In particular, go to the gemstone of the bundle and in lib / bundler / runtime.rb find the line that Kernel.require does and end it as follows:
puts Benchmark.measure("require #{file}") { Kernel.require file }.format("%n: %t %r")
You may need to add a βbenchmarkβ somewhere in your application, for example, in config / boot.rb. This will show you how long it will take to require each gem. I canβt guarantee that your results will match mine, but I had a few gems that took more than a second to load compared to the sub-millisecond for most. Some of them were gems that I did not need for development, but I needed to perform some tasks in the development environment, for example. capistrano, shoulda. I compared other launch areas (initializers, etc.), but could not find any significant bottlenecks.
I still do not understand how to configure the application only to download those tasks where they are really needed. Perhaps I could create an environment called: speedy and use RAILS_ENV = speedy rails s / c to run when I know that I do not need these gems. Then in Gemfile I could use a group: quick to exclude these gems in certain cases.
All that said, the biggest annoyance for me is to download the whole environment to complete the rake task. I could rule out most of the stones for this, but the Gemfile will start to get confused, so I don't know if it's worth it.
Brian Deterling Feb 21 2018-11-21T00: 00Z
source share