Skip to content

Instantly share code, notes, and snippets.

@SgtPooki
Forked from mafintosh/node-tar.js
Last active January 21, 2021 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SgtPooki/604b33abb0318368cc33b67046e0016a to your computer and use it in GitHub Desktop.
Save SgtPooki/604b33abb0318368cc33b67046e0016a to your computer and use it in GitHub Desktop.
tar-fs vs node-tar benchmarks
// does not work...
var tar = require('tar');
var fstream = require('fstream');
var input = `node_modules`;
var reader = fstream.Reader({type: "Directory", path: input});
var pack = tar.Pack();
reader.pipe(pack).pipe(tar.Extract({path: '/tmp/destination-node-tar'}));
# Not my results.. it's from the original gist
time node tar-fs.js
real 0m34.261s
user 0m11.316s
sys 0m16.472s
time node node-tar.js
real 6m6.123s
user 3m8.837s
sys 2m43.491s
var tar = require('tar-fs');
var input = `node_modules`;
tar.pack(input).pipe(tar.extract('./tmp/destination-tar-fs'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment