# Optimize Rust AWS Lambda Functions

Rust Lambda functions can waste cost through slow I/O, cold starts, and poor memory settings. This skill reviews handlers and deployment settings, then suggests concrete performance and cost improvements.

## Install

```bash
npx skillstore add emillindfors/lambda-optimization-advisor
```

## Metadata

- Status: approved
- Slug: emillindfors-lambda-optimization-advisor
- Version: 1.0.0
- Author version: 1.0.0
- Skillstore revision: r1
- Version status: valid
- Tree hash: ea9b4e894b6bea9b3ec2660dbd8cfe03b4bcd3e039c598842139b7d5978aa2b6
- Author: EmilLindfors
- GitHub username: EmilLindfors
- License: MIT
- Repository: https://github.com/EmilLindfors/claude-marketplace/tree/main/plugins/rust-lambda/skills/lambda-optimization-advisor
- Ref: a06681402992ceae98ba04d54cfd4ab004862696
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 80
- Quality tier: silver
- Public page: https://skillstore.pages.dev/skills/emillindfors-lambda-optimization-advisor
- Manifest: https://skillstore.pages.dev/api/skills/emillindfors-lambda-optimization-advisor/manifest

## Capabilities

- Identifies sequential async work that could use Tokio join patterns.
- Reviews whether expensive clients are initialized once and reused.
- Suggests Cargo release profile settings for smaller Lambda binaries.
- Recommends ARM64 builds when price and performance fit the workload.
- Explains memory sizing tradeoffs for CPU-bound and simple functions.
- Highlights batch processing and early validation patterns for lower cost.

## Use Cases

- Review a New Handler: Find performance risks before a Rust Lambda handler reaches production.
- Reduce Serverless Cost: Identify memory, architecture, and batching changes that may lower Lambda spend.
- Improve Cold Starts: Check binary size and resource initialization patterns that affect startup time.

## Prompt Templates

### Basic Lambda Review

```
Review this Rust AWS Lambda handler for simple performance and cost improvements. Focus on async work, client creation, and memory settings.
```

### Cold Start Check

```
Analyze this Rust Lambda project for cold start risks. Review Cargo release settings, binary size choices, resource initialization, and architecture options.
```

### Cost Optimization Pass

```
Review this Lambda code and deployment configuration for cost optimization. Look for memory sizing, batching, early returns, ARM64 suitability, and avoidable latency.
```

### Advanced Production Audit

```
Perform a production readiness audit for this Rust Lambda workload. Prioritize issues by expected impact, confidence, operational risk, and measurement steps.
```

## Limitations

- It provides review guidance and does not run benchmarks.
- It cannot inspect AWS account metrics unless the user provides them.
- It focuses on Rust Lambda functions, not every Lambda runtime.
- It does not deploy or change infrastructure by itself.

## Best Practices

- Provide the handler, Cargo.toml, and deployment settings for the most useful review.
- Validate recommendations with production-like load tests before changing memory or architecture.
- Ask for impact estimates and measurement steps when comparing several optimizations.

## Anti Patterns

- Do not apply concurrency suggestions when operations depend on each other.
- Do not increase memory without measuring latency and total cost together.
- Do not treat example deployment commands as automatic infrastructure changes.

## Security Audit

- Audited at: 2026-07-06T14:56:03.555\+00:00
- Summary: All static findings appear to be false positives from markdown code fences, inline code formatting, documentation placeholder URLs, or illustrative Rust examples. No prompt injection, malware intent, credential access, host reconnaissance, or executable command path was found in SKILL.md.

## Stats

- Views: 134
- Downloads: 10
- Favorites: 0
- Popularity score: 0
