ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r918989 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/AntClassLoader.java
Date Thu, 04 Mar 2010 13:47:36 GMT
Author: bodewig
Date: Thu Mar  4 13:47:35 2010
New Revision: 918989

URL: http://svn.apache.org/viewvc?rev=918989&view=rev
Log:
reduce performance loss in AntClassLoader from 1000% to about 50%.  PR 48853

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=918989&r1=918988&r2=918989&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Mar  4 13:47:35 2010
@@ -51,6 +51,10 @@
  * Broken Pipe issue under Ubuntu Linux
    Bugzilla Report 48789    
 
+ * AntClassLoader in Ant 1.8.0 has been considerably slower than in
+   1.7.1
+   Bugzilla Report 48853
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java?rev=918989&r1=918988&r2=918989&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java Thu Mar  4 13:47:35 2010
@@ -17,6 +17,7 @@
  */
 package org.apache.tools.ant;
 
+import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -1213,8 +1214,9 @@
             JarEntry ent = jarFile.getJarEntry(entry);
             if (ent != null) {
                 // must read the input in order to obtain certificates
-                is = jarFile.getInputStream(ent);
-                while (is.read() >= 0);
+                is = new BufferedInputStream(jarFile.getInputStream(ent));
+                byte[] b = new byte[BUFFER_SIZE];
+                while (is.read(b, 0, BUFFER_SIZE) >= 0);
             }
             return ent == null ? null : ent.getCertificates();
         } finally {



Mime
View raw message