Hi,
I have found a performance problem related to multiple unrelated calls to 'jobManagement.callExtension'.
Problem is that during the creating of the node using NodeBuilder, all unknown method calls are delegated to 'jobManagement.callExtension'.
Example:
Node emailNode = new NodeBuilder().'hudson.plugins.emailext.ExtendedEmailPublisher' {
recipientList(context.recipientList ? context.recipientList.join(', ') : '$DEFAULT_RECIPIENTS')
configuredTriggers(context.triggersContext.configuredTriggers)
contentType(context.contentType)
defaultSubject(context.defaultSubject ?: '')
defaultContent(context.defaultContent ?: '')
attachmentsPattern(context.attachmentPatterns.join(', '))
presendScript(context.preSendScript ?: '')
classpath {
context.additionalGroovyClasspath.each { classpath ->
'hudson.plugins.emailext.GroovyScriptPath' {
path(classpath ?: '')
}
}
}
attachBuildLog(context.attachBuildLog)
compressBuildLog(context.compressBuildLog)
replyTo(context.replyToList ? context.replyToList.join(', ') : '$DEFAULT_REPLYTO')
saveOutput(context.saveToWorkspace)
disabled(context.disabled)
}
All node methods like `recipientList' would trigger 'jobManagement.callExtension' and scanning of the classpath.
Solution is to prefix all calls with `.delegate`, but would you accept a PR that makes this kind of changes?
Node emailNode = new NodeBuilder().'hudson.plugins.emailext.ExtendedEmailPublisher' {
delegate.recipientList(context.recipientList ? context.recipientList.join(', ') : '$DEFAULT_RECIPIENTS')
delegate.configuredTriggers(context.triggersContext.configuredTriggers)
delegate.contentType(context.contentType)
delegate.defaultSubject(context.defaultSubject ?: '')
delegate.defaultContent(context.defaultContent ?: '')
delegate.attachmentsPattern(context.attachmentPatterns.join(', '))
delegate.presendScript(context.preSendScript ?: '')
delegate.classpath {
context.additionalGroovyClasspath.each { classpath ->
delegate.'hudson.plugins.emailext.GroovyScriptPath' {
delegate.path(classpath ?: '')
}
}
}
delegate.attachBuildLog(context.attachBuildLog)
delegate.compressBuildLog(context.compressBuildLog)
delegate.replyTo(context.replyToList ? context.replyToList.join(', ') : '$DEFAULT_REPLYTO')
delegate.saveOutput(context.saveToWorkspace)
delegate.disabled(context.disabled)
}