[izpack-devel] A very slow installation when the same files exist in more than one pack

Piotr Skowronek piotr at skowro.net
Mon Jan 28 23:44:43 CET 2008


Hi All,

I'm experiencing a problem with very slow installation of files that
have been declared in more than one pack. It is noticeable when packs
have c. 30MB+. I have traced the problem, it looks like that
InputStream.skip(....) operation is performed every time when
file belongs to a different pack. Skip operation takes lots of time,
and as it has to skip megs of data.

The questioned fragment of code can be found in Unpacker#run() around 
line 260,
and it looks like this:
    InputStream is = getPackAsStream(pf.previousPackId, pack.uninstall);
    pis = new ObjectInputStream(is);
    is.skip(pf.offsetInPreviousPack - 4);   // <-- very slow on big files!

My quick fix attempt was to replace InputStream with BufferedInputStream 
but installation
failed with following exeption:

java.io.StreamCorruptedException        at
java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2414) 
at
java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2447) 
at
java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2606)
at java.io.ObjectInputStream.read(ObjectInputStream.java:813)        at
com.izforge.izpack.installer.Unpacker.run(Unpacker.java:323)

Does anybody have any idea how can it be fixed?

Regards,
Piotr Skowronek



More information about the izpack-devel mailing list