AWS Lambda is attractive for .NET applications because it removes the need to manage servers while automatically scaling execution environments.
For ordinary Lambda functions, cold starts are already an important performance consideration. For durable workflows, the problem becomes more interesting because a workflow can execute multiple steps, pause, resume, retry failed operations, and potentially run for a long period.
AWS announced general availability of the AWS Lambda Durable Execution SDK for .NET in July 2026. The SDK provides C# developers with durable steps, waits, callbacks, durable Lambda invocation, and local testing capabilities.
That creates an important performance question for .NET teams:
How much startup overhead does a durable workflow introduce, and how does that overhead compare with the actual work performed by the workflow?
This article presents a practical benchmarking methodology rather than claiming a universal cold-start number. Actual latency depends on runtime version, memory configuration, deployment package, initialization code, workload, concurrency, and AWS environment.
What Is a Lambda Cold Start?
A cold start occurs when Lambda needs to create a new execution environment before running the function.
A simplified lifecycle is:
Incoming Request
|
v
Create Execution Environment
|
v
Initialize Runtime
|
v
Initialize Application
|
v
Run Handler
Lambda describes the initialization phase as including environment setup, runtime startup, code loading, and initialization code outside the handler. A reused environment can avoid this initialization work and is commonly referred to as a warm invocation.
For a latency-sensitive API, this distinction matters:
Cold invocation
----------------
Request
|
+--> Initialization
|
+--> Handler
|
v
Response
versus:
Warm invocation
----------------
Request
|
+--> Handler
|
v
Response
The benchmark should measure these separately.
What Changes With Durable Workflows?
A durable Lambda function is still a Lambda function, but the execution model adds checkpointing and replay.
AWS describes durable functions as using checkpoints to record workflow progress. When execution resumes, the function can replay from the beginning while skipping already-completed operations using their stored results.
The conceptual flow becomes:
Invocation
|
v
Step 1
|
v
Checkpoint
|
v
Step 2
|
v
Checkpoint
|
v
Wait
|
v
Invocation ends
|
...
|
v
Resume
|
v
Replay
|
v
Continue from checkpoint
This means a durable workflow can have multiple Lambda invocations over its lifetime.
Consequently, measuring only the first invocation does not tell the whole performance story.
The Benchmarking Question
A useful benchmark should answer several questions:
How long does a cold durable invocation take?
How long does a warm invocation take?
How much initialization time comes from the .NET application?
Does workflow configuration materially affect startup?
How much latency is introduced when a workflow resumes?
How does deployment package size affect initialization?
Does Native AOT change startup behavior?
How does memory configuration affect latency?
How does concurrency change cold-start frequency?
What portion of total workflow latency comes from cold starts versus business operations?
The goal is to separate these variables instead of producing one misleading benchmark number.
Benchmark Standard Lambda and Durable Lambda Separately
Start with two functions:
Function A
-----------
Standard .NET Lambda
Simple handler
Function B
-----------
Durable .NET Lambda
Equivalent business logic
The business operation should be as similar as possible.
For example:
Input
|
v
Validate
|
v
Calculate
|
v
Return
Then create a durable version:
Input
|
v
Durable Step: Validate
|
v
Durable Step: Calculate
|
v
Return
This comparison does not prove that one architecture is universally faster.
It tells you what overhead exists for your particular implementation.
Measure More Than End-to-End Latency
A single number such as:
Duration = 850 ms
does not explain the result.
Capture at least:
Request timestamp
Initialization duration
Handler duration
Total duration
Cold/warm classification
Memory configuration
Runtime version
Package size
Concurrency
Workflow step count
For durable workflows, also record:
Checkpoint operations
Replay events
Wait duration
Resume latency
Retry count
The benchmark should make it possible to distinguish:
Runtime startup
+
Application initialization
+
Durable execution overhead
+
Business logic
+
External service latency
Use a Repeatable Benchmark
A practical test matrix could be:
| Variable | Values |
|---|---|
| Function type | Standard / Durable |
| Memory | Several selected configurations |
| Deployment | ZIP / container where relevant |
| Compilation | JIT / Native AOT where supported |
| Workflow | 1 / 3 / 5 steps |
| Invocation | Cold / Warm |
| Concurrency | Low / Medium / High |
| External calls | None / Controlled dependency |
Do not change multiple variables without recording them.
For example, comparing:
Standard .NET 8
256 MB
ZIP
against:
Durable .NET
1024 MB
Container
Native AOT
does not isolate durable execution overhead.
Build a Minimal .NET Function First
Start with the smallest possible handler.
public class Function
{
public string FunctionHandler(string input)
{
return $"Processed: {input}";
}
}
This gives you a baseline for runtime and application initialization.
Then gradually add:
AWS SDK
Dependency Injection
Configuration
Logging
Database client
HTTP client
Business services
Durable SDK
Measure after each significant change.
This helps identify which dependencies are responsible for startup overhead.
Static Initialization Matters
.NET Lambda applications often initialize dependencies before the handler executes.
For example:
public class Function
{
private static readonly AmazonDynamoDBClient Client =
new();
public async Task<string> FunctionHandler(
string id)
{
// Business logic
return await Task.FromResult(id);
}
}
The static initialization can become part of startup work.
AWS recommends optimizing static initialization because imports, libraries, configuration, and connection setup can contribute to Lambda initialization latency.
The benchmark should therefore distinguish:
Runtime Initialization
+
Static Application Initialization
from:
Handler Execution
Benchmark Deployment Package Size
Package size can affect initialization behavior.
Create controlled versions:
Version A
---------
Minimal dependencies
Version B
---------
AWS SDK + application libraries
Version C
---------
Full production dependency set
Do not optimize package size blindly.
The goal is to determine whether a dependency materially affects your application's startup path.
A useful experiment is:
Package Size
|
v
Cold Start
rather than:
Package Size
|
v
Assumed Performance
Measure the relationship.
Benchmark Memory Configuration
Lambda allocates more CPU capacity as memory configuration increases.
Therefore, test several memory settings rather than assuming that the lowest memory value is the cheapest overall configuration.
For example:
| Memory | Cold p50 | Warm p50 | p95 | Cost/Invocation |
|---|---|---|---|---|
| Configuration A | Measure | Measure | Measure | Measure |
| Configuration B | Measure | Measure | Measure | Measure |
| Configuration C | Measure | Measure | Measure | Measure |
| Configuration D | Measure | Measure | Measure | Measure |
The actual values should come from your workload.
The useful question is:
Where is the latency/cost trade-off for this application?
AWS recommends performance testing for .NET Lambda workloads because application behavior and initialization characteristics vary.
Benchmark Native AOT
For .NET applications where startup latency matters, Native AOT is an important comparison.
AWS documents that .NET 8 Lambda functions can be compiled using Native AOT and that this can reduce cold-start time by removing runtime compilation work.
Create two otherwise equivalent builds:
Build A
-------
Regular .NET deployment
Build B
-------
Native AOT
Measure:
Cold initialization
Warm invocation
Package characteristics
Memory behavior
Function correctness
Do not assume Native AOT will always be the best choice.
It can introduce compatibility and trimming considerations, so functional testing is required alongside performance testing.
Benchmark SnapStart Where Applicable
AWS Lambda SnapStart is another startup optimization available for supported runtimes, including .NET. AWS describes SnapStart as restoring an initialized execution environment from an encrypted snapshot instead of performing the full initialization sequence for each new environment.
For .NET, AWS also documents runtime hooks that can be used to perform initialization before snapshot creation.
A broader experiment can therefore compare:
Standard
|
+--> Cold Start
Native AOT
|
+--> Cold Start
SnapStart
|
+--> Restore Latency
The benchmark should verify which optimizations are supported by the exact runtime and durable-function configuration being evaluated before drawing conclusions.
Durable Workflow Benchmark
Now introduce a durable workflow.
Conceptually:
Input
|
v
Step 1: Validate
|
v
Step 2: Process
|
v
Step 3: Persist
|
v
Result
Each durable step becomes a checkpointed unit of work.
AWS documents that a step checkpoints its result and that replay can use the stored result rather than executing the completed step again. This is also why non-deterministic operations should generally be placed inside steps.
The benchmark should measure:
Initial invocation
+
Step execution
+
Checkpointing
+
Resume invocation
+
Replay
+
Final completion
Why Step Count Matters
Compare:
Workflow A
-----------
1 durable step
with:
Workflow B
-----------
3 durable steps
and:
Workflow C
-----------
5 durable steps
This helps identify how workflow granularity affects total execution behavior.
A simple table:
| Workflow | Steps | Cold Start | Total Duration | Checkpoints |
|---|---|---|---|---|
| A | 1 | Measure | Measure | Measure |
| B | 3 | Measure | Measure | Measure |
| C | 5 | Measure | Measure | Measure |
Do not conclude that fewer steps are automatically better.
Durable steps provide fault-isolation, retry, and checkpoint boundaries.
The correct granularity depends on the workflow.
Cold Start Versus Replay
A durable workflow may resume after a wait or interruption.
For example:
Invocation 1
|
v
Step A
|
v
Checkpoint
|
v
Wait
|
v
Invocation ends
Invocation 2
|
v
Replay
|
v
Step B
|
v
Result
AWS describes this replay behavior as part of the durable execution model.
This means a benchmark should not label every resumed invocation simply as a "cold start."
Instead, classify events:
Initial Cold
Warm Continuation
Resume After Wait
Resume After Failure
New Execution Environment
These represent different performance scenarios.
Benchmark Durable Waits
A normal sleep keeps the invocation alive.
A durable wait does not.
AWS documents that durable wait suspends the function after checkpointing and resumes it later without consuming Lambda compute during the wait.
For example, conceptually:
await context.WaitAsync(
TimeSpan.FromMinutes(10));
The exact API should follow the version of the .NET SDK being used.
The important benchmark is:
Traditional sleep
vs
Durable wait
Measure:
Compute time
Resume latency
Total elapsed time
Do not compare only wall-clock duration.
A ten-minute workflow that spends ten minutes waiting is not equivalent to a ten-minute workflow consuming ten minutes of Lambda compute.
Benchmark External Service Calls
A realistic workflow may call:
Lambda
|
+--> DynamoDB
|
+--> S3
|
+--> HTTP API
|
+--> Payment Provider
External calls can dominate total latency.
Start with deterministic local computation:
No network
Then add:
DynamoDB
Then:
HTTP API
This lets you identify whether the observed latency comes from Lambda initialization or downstream dependencies.
Use Controlled External Latency
If you want to test workflow behavior under predictable conditions, use a controlled test dependency.
For example:
Test API
|
+--> 10 ms response
+--> 100 ms response
+--> 500 ms response
Then compare:
Workflow latency
vs
Dependency latency
This prevents a changing third-party service from contaminating the benchmark.
Benchmark Retries
Durable workflows support retry behavior for failed steps. AWS documents configurable retry strategies for durable steps.
A test can intentionally fail a step:
Attempt 1 -> Failure
Attempt 2 -> Failure
Attempt 3 -> Success
Measure:
Retry delay
Total workflow duration
Checkpoint behavior
Compute consumed
Final outcome
This is particularly important for workflows interacting with unreliable external services.
Join the conversation! Your thoughts help the community grow.