Updating two Lambda functions sounds like a small job. One update in saaslayer's dev environment took 441 seconds in the deployment state machine. Uploading the changed code accounted for only a small part of that time.
The useful question was where the rest of the operation spent its time. The deployment record included a breakdown:
| Step | Seconds |
|---|---|
| Plan the update | 161 |
| Apply the plan | 4 |
| Check drift | 54 |
| Run the update worker | 169 |
| Handle domains | 40 |
| Finalize | 5 |
The step durations total 433 seconds; the recorded state-machine elapsed time was 441 seconds. CLI wall time was 450 seconds. Those are different measurements.
These observations come from November dev work on a throwaway Users and Permissions deployment. They describe that setup and its revisions, rather than a production benchmark.
How the planner chose the work
The deployment used smart-ci to compare code, configuration and dependency fingerprints with the recorded deployment baseline. A shared-code change can affect several consumers, while a service whose inputs still match can be skipped when analysis is complete.
Dependent work is ordered through a directed acyclic graph (DAG): prerequisites run before the work that needs their outputs. For compatible code-only changes, the planner can select individual function updates instead of a full stack deployment.
That narrowed this run to two function updates, with Permissions unchanged. Preparation and checks still contributed to the total time.
Check what actually executed
The first trap was trusting the planned strategy. Earlier runs selected a code-only update, but the worker could not use that path with its configured Serverless entrypoint. It fell back to a full stack deploy.
The status reflected the plan. The worker log revealed the fallback.
For the 441-second run above, the records established that both function-code updates actually executed: the upload receipts succeeded, the function modification times advanced and the CloudFormation stack's update time remained at the previous full deployment.
Before comparing timings, check which operation ran. Otherwise a “code-only” result can quietly include a full deployment.
Separate preparation from the operation
The 169-second worker step included provisioning, checkout, dependency installation, packaging and the function updates. Provisioning, checkout and installation took about two minutes of that step. The planner also installed dependencies on its own path.
Reducing the number of updated functions could not remove those repeated costs. A prepared runner was a better candidate for reducing them.
A later run moved both planning and execution onto the Lambda runner. It updated two functions in 174 state-machine seconds:
| Step | Seconds |
|---|---|
| Plan | 22 |
| Execute the worker | 84 |
| Drift and domain phases | 52 |
The remaining time included preparation and finalization steps. The result made the next limits visible: packaging, checks and runner startup still contributed to elapsed time.
Several implementation details changed between the runs. The comparison is useful for understanding this deployment path; it does not isolate one change's speedup or predict another application's result.
Keep correctness checks attached to the faster path
This work also exposed a packaging defect. A second package invocation used default configuration instead of the deployment's parameters. Functions updated through that path could therefore receive different baked configuration from functions installed by the full deployment.
The fix reused the package produced with the module runner's stage and parameters. Readback compared the configuration in the updated function bundles with a function from the previous full deployment.
A shorter run would have been a poor result if it installed the wrong configuration. The timing investigation needed artifact verification as well as a stopwatch.
Use the same breakdown on your own deploy
For one representative update, record:
- What the plan selected and what each worker executed.
- Total state-machine time and CLI wall time separately.
- Preparation, packaging, resource changes, checks and finalization.
- Whether the resulting artifacts have the expected code and configuration.
Change the largest avoidable cost, then repeat the same kind of update and inspect the artifacts again. Keep the breakdown with the result so the next improvement starts from an observed cost.