Performance issues

20 views
Skip to first unread message

denis.s...@gmail.com

unread,
Jul 8, 2016, 5:24:36 AM7/8/16
to job-dsl-plugin
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)
}

Daniel Spilker

unread,
Jul 11, 2016, 2:55:27 AM7/11/16
to job-dsl...@googlegroups.com
I need to investigate this. I also want to see if there there is an alternative to adding "delegate." everywhere.

Please create a JIRA issue for this.

Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/c58cb3c5-68af-49fa-8538-f3da2773f9dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages