开发者

Rails, are many gems in gemfile slowing down the site?

I'm wondering if having many gems in the Gemfile are slowing down the site? Are they loaded when needed or are all loaded at every page re开发者_开发技巧quest?


It really depends on what gems you are using (i.e. middleware vs. just some small library). However in the general case, more gems = more code to process = more time = slower site.

One tip that I can suggest to you is in your Gemfile, do something like this:

gem 'gemname', :require => false

To not have rails require this gem on startup. The downside of course is that you have to manually call require 'gemname' whenever you want to use that gem. It's all a balance of performance vs. ease of use.


Bundler what is the require false on the gemfile means

I think that will answer your question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜