Performance profiling » History » Revision 3

Revision 2 (Radhika Chippada, 05/11/2015 07:08 PM) → Revision 3/7 (Radhika Chippada, 05/11/2015 07:12 PM)

h1. Performance profile workbench 

 h2. Problem 

 Workbench makes repeated calls for the same object(s) from the API server. Also, workbench sometimes makes multiple calls to the API server. For ex: get a link, one at a time rather than pulling all links needed by the object in one request from API server. This was observed several times in the past. And, we have used “preload-*” in those instances when we noticed this. 

 As recently as of fixing #5622, it was observed that each link was being retrieved in a separate call. Similar behavior is observed in #5908.  

 Given this, it is clear that we have this symptom in several areas in workbench. It is likely that we have other such problem patterns in our implementation. 

 Thus, it makes sense to do performance profiling of workbench to identify potential areas of improvement in workbench. This can also help identify API methods that can be tweaked to improve API server performance. 

 h2. Proposed solutions 


 h3. Profile using ruby-prof 

 In development environment, use rack-mini-profiler to profile workbench pages. 

 * Set the environment variable:     ENABLE_PROFILING=yes 

 * Visit a workbench page 
 ** After the page loads, you will see a clickable button at the top left corner (with the number of ms taken by the page) 
 ** Click on this button to see the profile breakdown of several assets in displaying this page 
 ** Append ?pp=help to see available options 
 ** Append ?pp=flamegraph to see a graphical representation of the profile (though I did not find this to be of much help in our workbench)