OSC / ondemand

Supercomputing. Seamlessly. Open, Interactive HPC Via the Web
https://openondemand.org/
MIT License
290 stars 107 forks source link

Dashboard: Explore faster start times by loading fewer gems #202

Open ericfranz opened 5 years ago

ericfranz commented 5 years ago

Follow the example of https://github.com/discourse/discourse/blob/master/Gemfile

Do require: false and start putting require statements in files that use these gems. By disabling eager loading we ensure every gem is not auto-loaded. Candidates for require 'false' include:

These are candidates for omitting:

Can explore replacing gem 'rails', '4.2.11' with:

gem 'actionpack', '4.2.11'
gem 'actionview', '4.2.11'
gem 'activemodel', '4.2.11'
gem 'activesupport', '4.2.11'
gem 'railties', '4.2.11'
gem 'sprockets-rails', '3.2.1'

And then requiring in config/application.rb only what is used:

require "active_model/railtie"
require "action_controller/railtie"
require "action_view/railtie"

I do not think we use these: action_mailer, active_job, active_record.

Group some gems in an group :assets such as uglifier.

All of these changes minimally would shave off 150 ms from load time, but could a lot more. Of course, the entire production app would need to be carefully tested.

┆Issue is synchronized with this Asana task by Unito

matt257 commented 4 months ago

reviewed, still a good idea