如果我们需要/在 Rails 应用程序中包含任何 gem 并仅使用其 2%,是否会出现任何问题(性能或其他问题)

发布于 2024-11-24 04:20:19 字数 166 浏览 8 评论 0原文

例如,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜柠檬 2024-12-01 04:20:19

主要缺点是更多的内存使用(特别是在这种情况下,因为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文