classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ZipFile patch (Was: eclipse status)


From: Mark Wielaard
Subject: ZipFile patch (Was: eclipse status)
Date: 02 Jan 2003 14:42:37 +0100

Hi,

On Tue, 2002-12-31 at 09:08, Tom Tromey wrote:
> >>>>> "Mark" == Mark Wielaard <address@hidden> writes:
> 
> Mark> Artur Biesiadowski has some real patches to reduce memory use in
> Mark> java.util.zip. But I am using the attached hacks which already make
> Mark> Eclipse reasonable usable on my 1.4Ghz machine
> 
> The ZipFile patch seems pretty reasonable to me.  I haven't read
> Artur's patch yet.  I assume it includes the equivalent.  Putting
> something like this in the tree sooner rather than later (i.e., no
> need to wait for a full review of Artur's entire patch) would be
> useful.

I asked Artur for his patch and used only his ZipFile changes since they
are the most useful for libgcj (not all other java.util.zip classes are
shared). The code changes are from Artur Biesiadowski, I only cleaned up
some comments and changed indentation a bit. The code changes that I
made which were not in Artur his original patch:
- removed the createTrustedInflaterStream() call since I didn't want to
merge InflaterInputStream at this moment.
- wrapped the PartialInputStream in an BufferedInputStream which saves
another couple of native read calls.

2003-02-01  Artur Biesiadowski  <address@hidden>
            Mark Wielaard  <address@hidden>

        * java/util/zip/ZipFile.java (entries): Now HashMap.
        (readLeShort(DataInput, byte[])): Read from given byte array.
        (readLeInt(DataInput, byte[]): Likewise.
        (readLeShort(byte[] b, int off)): New method.
        (readLeInt(byte[] b, int off)): Likewise.
        (readEntries): Use byte arrays to read info in bigger chunks.
        (getEntries): Return HashMap.
        (getEntry): Use HashMap.
        (locBuf): New private field.
        (checkLocalHeader): Use locBuf to read info in one chunk.
        (getInputStream): Use entires HashMap, wrap PartialInputStream in
        BufferedInputStream.
        (ZipEntryEnumeration): Use HashMap and Interator.
        
Would it be OK to check this in libgcj (main and branch) and Classpath
for now since it speeds up zip file reading so much? Hopefully John
Leuner can review the other java.util.zip changes.

Cheers,

Mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]