Archive::Tar::Wrapper vs. Archive::Tar

If you don't know it, Archive::Tar is SLOW; it even says so. Running NYTProf recently on a project revealed that the major part of the program was taking a little more than 27 seconds to run and a little over 24 seconds of this was Archive::Tar reading the archive into memory. Since I did not need the in memory feature, I switched to Archive::Tar::Wrapper. That sub now takes about 2.5 seconds to run and the equivalent portion to Archive::Tar->new($file); is now Archive::Tar::Wrapper->new; $arch->read($file); now takes 631 ms.

Archive::Tar can be a real problem. A while back I patched dzil to use Archive::Tar::Wrapper if it's installed. This seems to make a difference for distros with a lot of files, like Moose.

It'd be nice to have an Archive::Tar::Any that tried the faster ones first, but Archive::Tar does more stuff than the others, from what I've seen. Maybe ::Any would just provide a small subset of the API (extract, create an archive, list its files, that's it).

It was seeing Archive::Tar::Wrapper in dzil that led me to it. I have a tarball that has all the statics I need but, there are dynamic files that need written to the tarball for each install. So, I am injecting the dynamic files in the tarball before transferring to the host it will be installed on.