Create a gist now

Instantly share code, notes, and snippets.

$ cat t.js
gc();
var before = process.memoryUsage();
var express = require(process.argv[2]);
gc();
var after = process.memoryUsage();
var diff = {}
for (var i in before) diff[i] = after[i] - before[i]
console.log(before)
console.log(after)
console.log(diff)
$ node --expose-gc t.js express
{ rss: 11915264, heapTotal: 6163968, heapUsed: 1460672 }
{ rss: 19935232, heapTotal: 10324992, heapUsed: 3298312 }
{ rss: 8019968, heapTotal: 4161024, heapUsed: 1837640 }
$ node --expose-gc t.js request
{ rss: 11804672, heapTotal: 6163968, heapUsed: 1460672 }
{ rss: 20979712, heapTotal: 15551232, heapUsed: 4157032 }
{ rss: 9175040, heapTotal: 9387264, heapUsed: 2696360 }
@Swatinem

So request is heavier than express, haha.
How about superagent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment