myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michał Kudła (JIRA) <...@myfaces.apache.org>
Subject [jira] Created: (MYFACES-3022) very slow class loading
Date Mon, 24 Jan 2011 07:36:46 GMT
very slow class loading
-----------------------

                 Key: MYFACES-3022
                 URL: https://issues.apache.org/jira/browse/MYFACES-3022
             Project: MyFaces Core
          Issue Type: Improvement
          Components: General
    Affects Versions: 2.0.3
         Environment: Geronimo on Linux Gentoo, Windows XP, Windows 7
            Reporter: Michał Kudła


Very slow classloading
this patch can load 1000 times faster


# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/m1k0/Projekty/opensource/repos/asf/myfaces/core/tags/myfaces-core-project-2.0.3/impl/src/main/java/org/apache/myfaces/view/facelets/util
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: Classpath.java
--- Classpath.java Base (BASE)
+++ Classpath.java Locally Modified (Based On LOCAL)
@@ -36,6 +36,7 @@
 import org.apache.myfaces.shared_impl.util.ClassUtils;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
+import java.util.HashSet;
 /**
  * @author Jacob Hookom
  * @author Roland Huss
@@ -44,6 +45,7 @@
  */
 public final class Classpath
 {
+    private static Set _history = new HashSet();
     private static final Charset UTF8 = Charset.forName("UTF-8");
     private Classpath()
     {
@@ -72,6 +74,13 @@
         for (Enumeration<URL> urls = loader.getResources(resource); urls.hasMoreElements();)
         {
             URL url = urls.nextElement();
+	    String key = url.toString();
+	    if (_history.contains(key)) 
+	    {
+		continue;
+	    }
+	    _history.add(key);
+	    
             URLConnection conn = url.openConnection();
             conn.setUseCaches(false);
             conn.setDefaultUseCaches(false);


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message