Skip to main content

High Performance
Lambdas with Rust

Get In Touch

Rust is a modern compiled language for high-performance, memory-safe applications.
Write (or rewrite) your critical Lambda functions in Rust to boost performance and reduce cost.

Why use Rust?

Performance: Rust’s design prioritises efficiency, giving execution times and a memory footprint compatible to native C/C++. Rust performs significantly better than other application language stacks (e.g. Python, Node.js, C# and Java)
Safety: Rust’s focus on memory safety mitigates common bugs like null pointer dereferencing and buffer overflows prevalent in C and C++.
Correctness: Rust’s type system highlights fallible calls and data absence, aiding developers in identifying and handling edge cases explicitly.
Productivity: With a robust type system, refined compiler, and extensive developer tool ecosystem, Rust empowers teams to achieve more.

Rust is the choice for (re)implementing performance-critical Lambda functions, given the Lambda pricing model is allocated memory x execution time.

Benefits

Improved Performance

Rust can deliver a significant boost for performance-critical Lambda functions slashing execution time.

Lower Cost

Rust’s efficient execution characteristics and low memory footprint can provide a significant cost reduction for highly used Lambda functions.

Reduced Cold Start Impact

Thanks to its performance characteristics, Rust can significantly reduce the cost of cold starts. Typically, Rust cold starts are in the order of 10-50ms, as opposed to 500-2000ms generally observed in Python, JavaScript and Java.

Reduced Carbon Footprint

By adopting Rust for your performance-critical Lambdas, you’re not just optimising for performance – you’re actively contributing to more sustainable cloud deployments.

Why now?

The global Rust developer community surged to approximately 2.8 million in 2023. Major tech players like Google, Microsoft and AWS are actively adopting Rust for their critical infrastructure.
Test the waters without committing to a massive rewrite Migrating a single Lambda function to Rust is a low-risk investment. Small and self-contained, Lambda functions often have minimal dependencies and consist of only a few hundred lines of code.

Benchmark: Rust vs Python

Why fourTheorem? We wrote the book on it.

Crafting Lambda Functions in Rust

A practical guide on how to build efficient, sustainable, cost-effective serverless AWS solutions with the Rust programming language.

We have been building Lambda functions using the Rust programming language for a while now and we have seen impressive results in terms of efficiency, cost, and sustainability. Now, we are on a mission to share everything we learnt so far.

Learn more
lambda-functions-in-rust-book

Have a question?

Get in touch with a member of our team below.