Book Image

Node.js High Performance

By : Diogo Resende
Book Image

Node.js High Performance

By: Diogo Resende

Overview of this book

Table of Contents (14 chapters)

Summary


In environments seen nowadays, it's very important to be able to profile an application to identify bottlenecks, especially at the processor and memory levels. Systems are complex and divided into several layers, so analyzing processor usage using call stacks can be really hard without some tools and visualization techniques, such as flame graphs. Overall, you should focus on your code quality before going for profiling.

As you saw in our example, a simple and effective solution for our server was to cache the results. Caching is a very important technique and is usually crucial in balancing resource usage. Normally, you have available memory and it's better to cache a result for a small period of time than to process it every time, specially when the result is imutable.

Next, we'll look at how you should use and store your data and how, when, and for how long you should cache it. We'll take a look at the pros and cons of some cache methodologies so that you can be more prepared to...