Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-24309

UberClassLoader does not cache negative results

    Details

    • Similar Issues:

      Description

      Running GroovyShell.parse, common as part of form validation for plugins offering Groovy scripting, is unnecessarily slow:

      java.lang.Thread.State: RUNNABLE
          at java.lang.Throwable.fillInStackTrace(Native Method)
          - locked <0x000000078fc42f48> (a java.lang.ClassNotFoundException)
          at java.lang.Throwable.<init>(Throwable.java:218)
          at java.lang.Exception.<init>(Exception.java:59)
          at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:65)
          at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1375)
          at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at jenkins.ClassLoaderReflectionToolkit.invoke(ClassLoaderReflectionToolkit.java:44)
          at jenkins.ClassLoaderReflectionToolkit._findClass(ClassLoaderReflectionToolkit.java:86)
          - locked <...> (a hudson.ClassicPluginStrategy$AntClassLoader2)
          at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:1042)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          - locked <...> (a hudson.PluginManager$UberClassLoader)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
          - locked <...> (a groovy.lang.GroovyClassLoader)
          at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:692)
          at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:560)
          at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:183)
          at ...
          at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)
          - locked <...> (a java.util.HashMap)
          at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
          at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
          at groovy.lang.GroovyShell.parse(GroovyShell.java:770)
      

      Should cache negative class loads, since these are common when compiling Groovy at least.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Aggravated by JENKINS-23784: if one thread is holding the lock and taking its time, other threads can queue up rather than utilizing multiple cores.

            Show
            jglick Jesse Glick added a comment - Aggravated by JENKINS-23784 : if one thread is holding the lock and taking its time, other threads can queue up rather than utilizing multiple cores.
            Hide
            jglick Jesse Glick added a comment -

            With some optimizations I can get class loading time down to around 2.5% of the doCheckScript time, meaning other things internally in Groovy take up almost all of the time.

            Show
            jglick Jesse Glick added a comment - With some optimizations I can get class loading time down to around 2.5% of the doCheckScript time, meaning other things internally in Groovy take up almost all of the time.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/PluginManager.java
            http://jenkins-ci.org/commit/jenkins/cd33cdd8b73240b165cda665d1c4413be7b93d66
            Log:
            [FIXED JENKINS-24309] Caching class loads and misses from UberClassLoader.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/PluginManager.java http://jenkins-ci.org/commit/jenkins/cd33cdd8b73240b165cda665d1c4413be7b93d66 Log: [FIXED JENKINS-24309] Caching class loads and misses from UberClassLoader.
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3625
            [FIXED JENKINS-24309] Caching class loads and misses from UberClassLoader. (Revision cd33cdd8b73240b165cda665d1c4413be7b93d66)

            Result = SUCCESS
            Jesse Glick : cd33cdd8b73240b165cda665d1c4413be7b93d66
            Files :

            • core/src/main/java/hudson/PluginManager.java
            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3625 [FIXED JENKINS-24309] Caching class loads and misses from UberClassLoader. (Revision cd33cdd8b73240b165cda665d1c4413be7b93d66) Result = SUCCESS Jesse Glick : cd33cdd8b73240b165cda665d1c4413be7b93d66 Files : core/src/main/java/hudson/PluginManager.java changelog.html

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: