如果我们需要/在 Rails 应用程序中包含任何 gem 并仅使用其 2%,是否会出现任何问题(性能或其他问题)
例如,rmagick,我们仅使用它来制作缩略图,也就是说我们只使用该 gem/lib 的 2%。
不使用 rmagick 只是为了制作缩略图并从 sh 脚本调用 image-magic api 是否有意义,因此不要在 Gemfile 中指定太多 gem,减少依赖等?
想知道专家的意见。
For instance, rmagick, we use it just for making thumbnails which, say we only make use of 2% of that gem/lib.
Will it make sense not to use rmagick just for the purpose of making thumbnails and call image-magic apis from sh script, and hence not to have too many gems specified in Gemfile, less dependency etc?
Want to know experts opinions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
主要缺点是更多的内存使用(特别是在这种情况下,因为 rmagick 因内存泄漏而闻名)。我建议使用 mini_magick gem 作为较小的替代品。
写得不好的 gem 也有可能会破坏应用程序中的其他内容。
The main disadvantage is more memory use (especially in this case because rmagick has a reputation for memory leaking). I suggest the mini_magick gem as a smaller replacement.
There's also the possibility that a badly written gem might break something else in your app.