Skip to main content

lambda-bench

CI PyPI Coverage

Benchmarks AWS Lambda cold and warm start performance across memory tiers and runtimes (Python vs Go). Produces percentile stats, cost-proxy calculations, and publication-ready plots.

[!NOTE] AI Transparency Disclosure: This project utilizes AI coding assistants to generate boilerplates, optimize benchmarks, and refine documentation. All critical logic and performance calculations are human-reviewed and verified.

Example output

Cold start breakdown

Full example run → examples/go-vs-python/

Install

pip install lambda-bench

Or with uv:

uv tool install lambda-bench

Usage

Run a benchmark

lambda-bench run \
  --config functions.json \
  --cold-iters 15 \
  --warm-iters 15 \
  --region ca-west-1 \
  --output-dir results/

Re-plot from saved results (no re-invocation)

lambda-bench plot results/executions.json --output-dir results/plots/

Diff two result files

lambda-bench compare results/before.json results/after.json

Config format

functions.json is a list of function descriptors:

[
  { "label": "Python 512MB", "function_name": "my-func-python", "memory_mb": 512, "variant": "python" },
  { "label": "Go 512MB",     "function_name": "my-func-go",     "memory_mb": 512, "variant": "go"     }
]

IAM policy

The invoking principal needs:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "lambda:InvokeFunction",
        "lambda:UpdateFunctionConfiguration",
        "lambda:GetFunctionConfiguration"
      ],
      "Resource": "arn:aws:lambda:*:*:function:*"
    }
  ]
}

Outputs

File Contents
executions.json Raw Report objects — feed to lambda-bench plot or compare
executions.csv Flat CSV for spreadsheet analysis
plots/*.png Histograms, p50/p95 bars, billed duration vs memory, cost proxy, cold-start breakdown

Development

uv sync --dev
uv run pytest
uv run ruff check src tests
uv run mypy src

Release files for lambda-bench 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lambda-bench 0.2.0
File Size Uploaded
lambda_bench-0.2.0.tar.gz 212.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lambda-bench 0.2.0
File Interpreter ABI Platform
lambda_bench-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 238.8 kB

Release files / lambda_bench-0.2.0.tar.gz

Download URL lambda_bench-0.2.0.tar.gz
Size 212.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5db89443c6e77137b0b95d51dda7b0314dba530584a23c3c2319e165d24ec4e2
BLAKE2b-256 checksum
How to use checksums
b61924bba48ffeb8464358ceffc90a2aa57d6890ac711606458fb1ba6e6a8790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lambda_bench-0.2.0-py3-none-any.whl

Download URL lambda_bench-0.2.0-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef830c1f52211eda933c1156cff29ac8a6fe9e06d62b73278a953c5fb1435fa5
BLAKE2b-256 checksum
How to use checksums
649d834998137a039dd1c0ace0c5f3b757d1c03f5ef281fbfb3ee5820dc13ed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page