It's easy to accidentally write slow code in our applications. In this episode, we look at how we can benchmark our code and examples of some methods which are slower than others.
Benchmarking and Refactoring the content_for View Helper
#90
Jul 23, 2017free
In a recent blog post, we looked into the content_for view helper to render breadcrumbs. Once we got the feature working, it's time to refactor the feature to lower technical debt.
In this episode, we'll dive into ActiveSupport::Notifications to perform simple metrics. We'll then use this technique to troubleshoot and pinpoint where slow running lines of code are. It can be a great debugging technique when trying to deal with slow requests or functions.
A continuation from Episode 20 where we explore rendering the user's edit pages in a modal on a per request basis. Instead of rendering all modals for the users in the index, we will request them using remote javascript.