Issue Type: Improvement Improvement
Assignee: Unassigned
Components: core
Created: 14/Jul/14 9:49 PM
Description:

When running on Java 7, Jenkins should ensure that all its ClassLoader instances are marked parallel-capable. This would improve class loading speed in some circumstances—mainly during startup or when first using new features, but also when searching for Groovy imports and the like.

At least UberClassLoader, DependencyClassLoader, AntClassLoader2, and PluginFirstClassLoader should be so marked. (PluginFirstClassLoader ought to be made to extend AntClassLoader2 since we control it; all superclasses must be marked.) To work on Java 7, can use this idiom:

try {
    Method m = ClassLoader.class.getDeclaredMethod("registerAsParallelCapable");
    m.setAccessible(true);
    boolean b = (Boolean) m.invoke(null);
    if (!b) {
        ...warn...
    }
} catch (NoSuchMethodException x) {
    // fine, Java 6
} catch (Exception x) {
    ...warn...
}

(Unfortunately this pattern must be repeated in such class, since registerAsParallelCapable is caller-sensitive.)

Project: Jenkins
Labels: classloader performance threads
Priority: Major Major
Reporter: Jesse Glick
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to