classpath
[Top][All Lists]
Advanced

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

Re: eclipse status (summary: it looks nice)


From: Mark Wielaard
Subject: Re: eclipse status (summary: it looks nice)
Date: 24 Dec 2002 10:10:48 +0100

Hi,

On Tue, 2002-12-24 at 02:20, Anthony Green wrote:
> > Part of this is caused by the fact that the
> > VMClassLoader keeps tries to load new classes first by first trying to
> > open the lib-sub-package-class.so files. But since there are no natively
> > compiled classes it keeps falling back to the interpreter. We must cache
> > the result of Runtime.(internal)loadLibrary() somewhere.
> 
> That's a good idea.  I also noticed that we create a lot of garbage when
> loading bytecode from jarfiles.

Didn't actual implement my idea. I just disabled the loadin completely
since it isn't needed for how we run Eclipse at the moment.
Artur Biesiadowski has some real patches to reduce memory use in
java.util.zip. But I am using the attached hacks which already make
Eclipse reasonable usable on my 1.4Ghz machine (Getting to the Hello
World code completion example now takes "just" 140MB.)

> > Is your version of Eclipse based on 2.0.2 or 2.1-M4?
> 
> 2.0.1 (admittedly, I'm not using our latest development version)

2.1-M4 is already faster.

Cheers,

Mark
Index: gnu/gcj/runtime/natVMClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/runtime/natVMClassLoader.cc,v
retrieving revision 1.1
diff -u -r1.1 natVMClassLoader.cc
--- gnu/gcj/runtime/natVMClassLoader.cc 11 Dec 2002 03:15:14 -0000      1.1
+++ gnu/gcj/runtime/natVMClassLoader.cc 24 Dec 2002 09:04:39 -0000
@@ -46,7 +46,7 @@
        {
          using namespace ::java::lang;
          Runtime *rt = Runtime::getRuntime();
-         jboolean loaded = rt->loadLibraryInternal (so_base_name);
+         jboolean loaded = false; // rt->loadLibraryInternal (so_base_name);
 
          jint nd = so_base_name->lastIndexOf ('-');
          if (nd == -1)
Index: java/util/zip/ZipFile.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/zip/ZipFile.java,v
retrieving revision 1.19
diff -u -r1.19 ZipFile.java
--- java/util/zip/ZipFile.java  3 Dec 2002 22:06:31 -0000       1.19
+++ java/util/zip/ZipFile.java  24 Dec 2002 09:04:39 -0000
@@ -136,6 +136,7 @@
     this.name = file.getName();
   }
 
+  private final byte[] ebs  = new byte[24];
   /**
    * Read an unsigned short in little endian byte order.
    * @exception IOException if a i/o error occured.
@@ -143,9 +144,8 @@
    */
   private final int readLeShort(DataInput di) throws IOException
   {
-    byte[] b = new byte[2];
-    di.readFully(b);
-    return (b[0] & 0xff) | (b[1] & 0xff) << 8;
+    di.readFully(ebs, 0, 2);
+    return (ebs[0] & 0xff) | (ebs[1] & 0xff) << 8;
   }
 
   /**
@@ -155,10 +155,9 @@
    */
   private final int readLeInt(DataInput di) throws IOException
   {
-    byte[] b = new byte[4];
-    di.readFully(b);
-    return ((b[0] & 0xff) | (b[1] & 0xff) << 8)
-           | ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16;
+    di.readFully(ebs, 0, 4);
+    return ((ebs[0] & 0xff) | (ebs[1] & 0xff) << 8)
+           | ((ebs[2] & 0xff) | (ebs[3] & 0xff) << 8) << 16;
   }
 
   /**
@@ -192,7 +191,6 @@
 
     entries = new Hashtable(count);
     raf.seek(centralOffset);
-    byte[] ebs  = new byte[24];
     ByteArrayInputStream ebais = new ByteArrayInputStream(ebs);
     DataInputStream edip = new DataInputStream(ebais);
     for (int i = 0; i < count; i++)
@@ -202,7 +200,7 @@
        if (raf.skipBytes(CENHOW - CENVEM) != CENHOW - CENVEM)
          throw new EOFException(name);
 
-       raf.readFully(ebs);
+       raf.readFully(ebs, 0, 24);
        ebais.reset();
        int method = readLeShort(edip);
        int dostime = readLeInt(edip);

reply via email to

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