From the course: Node.js: Debugging and Performance Tuning

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Profiling code execution

Profiling code execution

From the course: Node.js: Debugging and Performance Tuning

Start my 1-month free trial

Profiling code execution

- [Instructor] So far, we've used external tools and internal code changes to get a glimpse into the performance of our application's code execution. There's another technique that's already built into node, profiling. Software profiling is a form of dynamic program analysis, which means that the program is actually running when the analysis is performed. Profiling can answer questions like the number of times each method is called and how long the methods take. Often, these include resource usage such as the amount of memory or CPU that's used. Node has a built-in profiler which in turn uses the V8's profiler. Node's profiler records important events such as just-in-time compiles and regular samples. The record of these events in samples is saved to a log file. On their own, these profiler logs aren't very useful. The information is better read with a tool that aggregates events and produces reports. Fortunately, Node also includes a V8 profiler processor that we're going to use…

Contents