1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var fs, http, longAssString, pathToABigFile, server;


// CHANGE THIS PATH TO A FILE THAT'S +1MB
pathToABigFile = './kd.js';

fs = require('fs');

http = require('http');

longAssString = fs.readFileSync(pathToABigFile, 'utf8');

server = http.createServer(function(req, res) {
  return res.end(longAssString);
});

server.listen(1337)

// RUN THE CODE, RUN LOCALHOST:1337 EACH TIME YOU REFRESH THE PAGE
// YOU SHOULD SEE A CPU HIT %5-10