Chrome Developer Tools is a great utility at the disposal of developers, right from writing code and debugging it locally, to monitoring deployed code on the server. Let's explore the different ways in which we can profile our deployed JavaScript code.
Let's take a look at how we can perform memory profiling using Chrome Developer Tools.
Recollect our string concatenation example from Chapter 1, Efficient Implementation of Basic Data Structures and Algorithms where we compared the concat
operator versus the +=
operator as two ways to perform concatenation. The resultant string was the same in both cases, but, if you remember, one method resulted in a memory explosion. Let's try to look at how we could have caught this with the Chrome Developer Tools memory profiler.