Memory profiling

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.

You can open the developer tools on Chrome by hitting CMD+SHIFT+I on a Mac or CTRL+SHIFT+I on a PC. On the Dev Tools there are several tabs, each of them serving a specific purpose. The Elements tab can be ...

Get TypeScript High Performance now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.