|
| 1 | +# Extension Performance Benchmarks |
| 2 | + |
| 3 | +Measures the init duration and memory overhead added by the Dash0 Lambda extension across all supported runtimes. |
| 4 | + |
| 5 | +## What it measures |
| 6 | + |
| 7 | +For each runtime version (Python 3.10-3.14, Node.js 20/22/24, Java 17/21/25), two Lambda functions are deployed: |
| 8 | +- **Baseline**: minimal handler, no layer |
| 9 | +- **Instrumented**: same handler with the Dash0 extension layer |
| 10 | + |
| 11 | +Each function is invoked multiple times with forced cold starts. Init duration and max memory used are extracted from the Lambda REPORT line (via `LogType: Tail`). |
| 12 | + |
| 13 | +## Running via GitHub Actions |
| 14 | + |
| 15 | +Trigger the `Benchmark` workflow manually from the Actions tab. Inputs: |
| 16 | +- `cold_start_invocations`: number of cold starts per function (default: 10) |
| 17 | +- `commit_results`: whether to commit results back to the repo |
| 18 | + |
| 19 | +## Running locally |
| 20 | + |
| 21 | +```bash |
| 22 | +# Prerequisites: AWS credentials configured, layers already published |
| 23 | + |
| 24 | +# Deploy the benchmark stack |
| 25 | +cd benchmarks/iac |
| 26 | +npm ci |
| 27 | +npx cdk deploy |
| 28 | + |
| 29 | +# Install script dependencies & run |
| 30 | +cd ../scripts |
| 31 | +npm ci |
| 32 | +npx tsx run-benchmark.ts |
| 33 | + |
| 34 | +# Clean up |
| 35 | +cd ../iac |
| 36 | +npx cdk destroy --force |
| 37 | +``` |
| 38 | + |
| 39 | +### Environment variables |
| 40 | + |
| 41 | +| Variable | Default | Description | |
| 42 | +|---|---|---| |
| 43 | +| `RESOURCE_PREFIX` | `""` | Prefix for function/layer names | |
| 44 | +| `AWS_REGION` | `us-west-2` | AWS region | |
| 45 | +| `COLD_START_INVOCATIONS` | `10` | Number of cold starts per function | |
| 46 | +| `BENCHMARK_CONCURRENCY` | `10` | Max functions benchmarked in parallel | |
| 47 | +| `OUTPUT_FILE` | `results/YYYY-MM-DD.json` | Output file path | |
| 48 | + |
| 49 | +## Results |
| 50 | + |
| 51 | +Results are saved as JSON in `results/`. The script also prints a comparison table to stdout showing init duration and memory overhead per runtime. |
0 commit comments