KTar patch to fix speed problems with tar ioslave

Alexander Neundorf neundorf at kde.org
Sun Feb 8 19:38:01 CET 2004


Hi Jan,

thank you very much for your effort. 
I also know this problem, so it's really cool you come up with a patch :-)
And such a nice explanation.

On Sunday 08 February 2004 19:10, Jan Schaefer wrote:
> Hi,
>
...
> this is my first patch for kdelibs, so please be considerate. ;-)
> Instead of applying the compression filters to the actual device that is
> used by KTar, I use the compression filters to decompress the tar file and
> store the decompressed file in a temporary file. This temporary file is
> then used as the device for KTar. Now it is not necessary anymore to walk
> through the compression filter each time a file is extracted from the
> archive.
>
> The solution increases the extraction speed of tar.bz2 (and tar.gz) files
> dramatically. It takes now about two minutes to extract the whole 11MB Qt
> tar.bz2 on my computer.
>
> However, there is a little drawback because it needs disk extra space for
> the temporary file. But I cannot think of better solution.

Well, without the temp file it would be nicer. I didn't look at the 
implementation of the tar/gz/bz2 ioslave.
What's is actually taking so much time ? (I know, the decompression). 
ioslaves have a "special()" member, which you can use to implement 
non-standard things. Would it be possible to tune the tar and/or the gz/bz2 
so that they have to seek through the whole file at first and then cache the 
offsets where the file starts so that for the second file they know already 
where the data starts which has to be uncompressed ? Is this possible ?

Bye
Alex
-- 
Work: alexander.neundorf at jenoptik.com - http://www.jenoptik-los.de
Home: neundorf at kde.org                - http://www.kde.org
      alex at neundorf.net               - http://www.neundorf.net


More information about the Kde-optimize mailing list