2 ms·
> The first [caveat] is that lzbench isn’t able to compress an entire directory like tar , so I opted to use lib/npm.js for this test. As opposed to... just us
by sfink 3y ago
> The first [caveat] is that lzbench isn’t able to compress an entire directory like tar , so I opted to use lib/npm.js for this test.
As opposed to... just using the npm-9.7.1.tar file that the other tests were just using (sorta barely internally to tar, but I don't think tar does any fancy streaming or anything if you're passing something via --use-compress-program, certainly nothing that would skew the results more than replacing all of npm.tar with just npm.js.)
In my local install, npm.tar is 25MB. npm.js is 16KB. It may not change the final outcome, but the data in the article do not support the conclusion. I would strongly suggest tarring up the npm directory and rerunning lzbench.
- kevincox 3y agoI think the author is unaware that `tar --compress-program foo` is equivalent to `tar | foo` (other than handling output writing and things. The analysis would have been much simpler, clearer and more focused on the compressor if they just benchmarked the compression with an already-generated tar archive. (Notably zip is different where files are compressed individually in the archive)