From fee9432d8bfe270515ea4af55022cb63cb5e5ee1 Mon Sep 17 00:00:00 2001 From: Shifa Date: Wed, 9 Oct 2024 18:00:15 -0400 Subject: [PATCH] Add notes to improve performance For rails applications with hundreds of models, the startup time can be affected if the gem loads by default. Moreover, the page is sluggish on browsers like Safari and Firefox and requires frequently refreshing the page. Chromium based browsers load the page much faster on observation. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index af7b296..c4e2da5 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,20 @@ If you share this file, it can be used by those who do not have a Ruby on Rails It would be very smart to generate it automatically using CI. + +#### Performance +For bigger rails applications, to avoid increasing app startup time, you can add `require: false` to the gemfile - +``` +gem "rails-mermaid_erd", group: :development, require: false +``` + + +And open the heavy mermaid_erd/index.html file in Google Chrome directly for more a responsive experience - +``` +bundle exec ruby -r rails-mermaid_erd -S rails mermaid_erd && open -a "Google Chrome" mermaid_erd/index.html +``` + + ## Configuration `./config/mermaid_erd.yml` to customize the configuration.