Cliff Crosland, CEO, Co-founder, Scanner.dev
DescriptionGiven the extremely fast startup time and low memory usage of Rust binaries, using Rust in a serverless environment like AWS Lambdas is appealing. Rust launches extremely quickly from a cold start and uses little memory compared to other languages.
Our team wanted to use Lambda functions to scan through terabytes of data in S3 extremely quickly, and we needed to choose the fastest language for the job.
In this talk, I'll show how we compared Rust's performance in AWS Lambda functions against other languages, specifically Go, Java, and Python. I'll also cover some surprising ways you can tune Lambda performance, like how increasing lambda memory allocation will actually increase network bandwidth to S3, and more.
Takeaways- Rust's cold-start time is the lowest, but with recently released features like Lambda SnapStart, the gap is closing for languages like Java (although there are many limitations). Go is not far either.
- For highest multi-threaded performance for CPU-intensive tasks, Rust wins, but Go and Java work fine for many of these use cases.
- Network bandwidth to S3 increases as you increase memory allocation, but it eventually plateaus at 90 MBps when memory allocated is between 512MB and 1024MB.