What happens during deployment?

Our deployments take about 5 minutes between the “InitializeJob Build succeeded” and “DeployBuildJob started” - what is actually happening during that step? Is there anything we can do in our code to optimize it?

This is likely related to bundle size combined with the 4.x infrastructure. Optimizing bundle size will help, but builds should be benchmarked against the latest 4.x build and associated infra.

How does the deployment system handle errors or failures during the initialization phase? Could error handling be improved to minimize delays and streamline the deployment process? Anyone have idea?