Performance Impact of Using Ruby on Rails View Partials
05-Nov-2020 1272
Ruby on Rails view partials can help keep your codebase DRY, but misusing them can have a significant performance impact.Ruby on Rails view partials can help keep your codebase DRY (Don’t Repeat Yourself) but misusing them can have a significant performance impact. In this blog post, I’ll describe when you should avoid using view partials and the alternatives. Measuring The Performance Impact Let’s start by checking how much slower your app could be when running on partials. I’ve tested the Ruby 2.7, Rails 6 app using Siege. The app was configured in the production environment with Puma server, running locally to eliminate the networking overhead. The hardware was a 15 inch MacBook Pro with 2.2 GHz and 16GB RAM.Simplified code for the tested endpoint looks like this:.
Performance Impact of Using Ruby on Rails View Partials #ruby #rubydeveloper #rubyonrails #Performance #Impact #Using #Rails #Partials #performance https://rubyonrails.ba/link/performance-impact-of-using-ruby-on-rails-view-partials