As a user of pipeline, I WANNA GO FAST.
One problem is that we have a bunch of mutable state attached to the WorkflowRun, and in the CpsFlowExecution, which results in constantly saving-and-re-saving the run, costing IO, CPU, and creating garbage to GC.
How do we fix that?
- Move the CpsFlowExecution fields heads and iota OUT and into either the program or the storage.
- May need to do some stuff in workflow-job plugin to accommodate the new impl – though it's created abstractly here – https://github.com/jenkinsci/workflow-job-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java#L263