0

For example:

In my Gemfile there are two gems:

gem 'spreadsheet', require: false

gem 'stripe', require: false

I use 'spreadsheet' in rake tasks and it's clear that require: false makes better performance.

But my rails app also uses 'stripe' for payment in app folder(models,controllers..etc) which is not often executed. (On production server, with config.eager_load = true )

Will the performance be better to set require: false for gem 'stripe' ?

I've read straight through this question but can't get clear answer: Bundler: What does :require => false in a Gemfile mean?

Community
  • 1
  • 1
brookz
  • 477
  • 5
  • 17

1 Answers1

1

You'll get some improvements in application start-up time - gems that have require: false are not loaded when application starts. This can also help in test mode - see https://www.andywaite.com/2015/08/15/faster-tdd-in-rails-with-bundlers-require-false.html. Also, if you only need those gems in rake tasks, or one-off scripts, the main application will use less memory, which is always a nice bonus.

hungmi
  • 335
  • 7
  • 11
eugen
  • 8,916
  • 11
  • 57
  • 65