Skip to content

Instantly share code, notes, and snippets.

@mafintosh
Last active December 7, 2023 12:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mafintosh/8102201 to your computer and use it in GitHub Desktop.
Save mafintosh/8102201 to your computer and use it in GitHub Desktop.
tar-fs vs node-tar benchmarks
var tar = require('tar');
var fstream = require('fstream');
var input = '/Users/maf/Downloads';
var reader = fstream.Reader({type: "Directory", path: input});
var pack = tar.Pack();
reader.pipe(pack).pipe(tar.Extract({path: '/tmp/destination-node-tar'}));
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 = '/Users/maf/Downloads';
tar.pack(input).pipe(tar.extract('/tmp/destination-tar-fs'));
@soichih
Copy link

soichih commented Apr 20, 2016

Another data point for tarring local directory and streaming it to a webserver via node-requests.

tar-fs

real    0m26.831s
user    0m5.146s
sys     0m1.644s

node-tar

real    1m5.001s
user    0m38.858s
sys     0m2.285s

@quentin-aslan
Copy link

Thanks

@chrisvdt
Copy link

I have a problem with tar-fs. when I try to tar a folder with multiple directories and files up to a total of 37GB it completes without errors, But when I try to extract the files I only get files back up to approximately 8GB. I'missing files.

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