Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2833

Classpath - improve speed up to 1000 times

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.0.1
    • None
    • General
    • None
    • sun-jdk-1.6.0.21, sun-jdk-1.7.0.0-b100, Gentoo Linux, Windoxs XP, 7

    Description

      1. This patch file was generated by NetBeans IDE
      2. Following Index: paths are relative to: /mnt/work/home/m1k0/Projekty/opensource/repos/asf/myfaces/core/branches/2_0_1/impl/src/main/java/org/apache/myfaces/view/facelets/util
      3. This patch can be applied using context Tools: Patch action on respective folder.
      4. It uses platform neutral UTF-8 encoding and \n newlines.
      5. 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)
            @@ -26,6 +26,7 @@
            import java.net.URLConnection;
            import java.net.URLDecoder;
            import java.util.Enumeration;
            +import java.util.HashSet;
            import java.util.LinkedHashSet;
            import java.util.Set;
            import java.util.jar.JarEntry;
            @@ -43,6 +44,9 @@
            */
            public final class Classpath
            {
            + // m1k0 - zabezpieczenie przed pętlą
            + static private Set history = new HashSet();
            +
            private Classpath()
            {
            }
            @@ -71,6 +75,14 @@
            {
            URL url = urls.nextElement();
            URLConnection conn = url.openConnection();
            + // m1k0 - zabezpieczenie przed pętlą
            + String key = url.toString();
            + if (history.contains(key)) { + System.out.println("url:" + url+" <<<<<<<<<<<<<<<<<<<<<< "); + continue; + }

            + history.add(key);
            + System.out.println(">>>>>>>>>>>>>>>>>>>>> url:" + url);
            conn.setUseCaches(false);
            conn.setDefaultUseCaches(false);

      This patch showing, that many times Classpath searching in the same place.

      After paching, all log was proccessed by grep and wc

      m1k0@laptok ~/Tymczasowy $ grep '>>>>' classloader-build.log | wc -l
      72
      m1k0@laptok ~/Tymczasowy $ grep '<<<<' classloader-build.log | wc -l
      7200

      In geronimo enviroment I have x 1000 times! This causes waiting 10 minuts for every deploy with myFaces

      Attachments

        1. classloader-build.log
          1.97 MB
          Michał Kudła
        2. Classpath.diff
          2 kB
          Michał Kudła

        Activity

          People

            lu4242 Leonardo Uribe
            m1k0 Michał Kudła
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: