Wednesday, February 07, 2007

over 60% performance boost for "tar xf"

"tar" is a commonly used single threaded utility for generating and extracting archives. With recent advances in filesystem implementations like e.g. Sun Solaris' ZFS, I read several time the wish that tar really should be multi-threaded to get better performance.

Well, I gave it a shot and wrote a preloadable binary patch that hands of write and close requests to worker threads. Unfortunately, I don't have a ZFS with many spindles, but I wanted to know if there might be a performance boost. So I tried it on a memory based TMPFS on a 4 processor Sun Fire V440 with 16GB of RAM running Solaris. I extracted a 1GB tar file first with the patched version of tar and then in single threaded mode. Result: over 60% performance improvement for the multi-threaded version.

I'd say it was worth the effort writing the patch. If you'd like to use it, too, you can get it here.