Interview Prep/Jenkins/Scripted pipeline, Groovy & CPS

Why is heavy Groovy in a Jenkinsfile bad for the controller?

IntermediateConceptScripted pipeline, Groovy & CPS
Answer

All pipeline Groovy (loops, string processing, JSON parsing, readFile content handling) runs on the controller JVM under CPS, which is much slower than normal Groovy and allocates heavily. One pipeline parsing a 50 MB JSON log can stall the controller for everyone. Push work into sh steps on the agent (jq, Python, a CLI tool) and keep Groovy as orchestration only.

All Jenkins questions Roadmap: Jenkins

More on Scripted pipeline, Groovy & CPS