Grokking Node.js
Vote

0% completed

​

Understanding Advanced Node.js Features

Counting the lines of a 62 MB log file with fs.readFile raised the memory of a Node.js process to 216 MB on our test machine. Counting the same lines while reading the file in pieces kept the process at 51 MB, and an empty Node.js process on that machine already uses about 45 MB. The second version used a stream, the first of the two features in this lesson. The second feature, worker threads, solves a different limit: work that keeps the CPU busy.

Streams

A stream is an object that moves data in pieces, called chunks, instead of all at once

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content