Battle of the Serverless — Part 1: Rust vs Go vs Kotlin vs F# vs C#

This weekend was supposed to be about some deep exploration on Go and dusting off my “archineer” and “engitect” hats. Some late night frustration with Go, however, on Friday prompted me to do some experimentation around serverless technologies in general; some benchmarking and studying. Read on if you want to see some observations and data points based on ~750,000 requests over 3 days on AWS Lambda, API Gateway, and some compiled serverless “hello world” type services; some are with AWS provided runtimes; some are with BYOR, or Bring-Your-Own-Runtime like Rust.

Battle of the Serverless “Hello Worlds”

For this test, I built a pretend suite of microservices exposed via API Gateway to form an API with a code name of Slipspace in a mock company called STG. Slipspace drives are how the ships in the Halo universe travel so quickly to different sectors of the galaxy through something called Slipstream Space, so thought it was cool for a name requiring awesome warp API speeds.

Quick observations

For now though, here are some quick observations:

  • Go (or @golang) is 95% of the way there for me; the 5% remaining is so weird it’s hard to describe. It’s that “good enough” language for microservices that is fun to learn, but it’s not for business logic. I was productive in it after only a day, and I’ve spent days afterwards wondering what else was there. Feels like the creators built it solely so that compilation was fast; it’s very simple, like 25-ish keywords, and embraces very simple concepts. It’s not elegant, but is pragmatic. Go had the best overall performance for my initial tests in cold and warm functions.
  • Rust is currently fascinating me. Feels like a modern C/C++ that brings a level of joy to me that I’ve not felt in a long time. Will be focusing on that tons in the future, feels like my new friend that I want to start traveling with. Rust was also very stable in the benchmark numbers. It turned in solid numbers in cold and warm functions, was not the fastest, but nearly a flat line with respect to performance (which is a good thing.) I’m hopeful that it’s the #1 loved language on Stack Overflow for good reason.
  • F# also intrigues me. I’m just burnt out on C# so it wasn’t that fun working through that test setup for me, but F# introduced functional programming in a way that was both familiar (.NET Core) and new. F# and C# on the .NET Core 2.1 runtime in AWS Lambda were quick when functions were warm, but was very inconsistent on cold starts and showed periodic spikes. Need to digest more F# to see if it has a place in my future.
  • Kotlin should have been introduced to me earlier in my career. Had I known Kotlin earlier, perhaps I would’ve gone through more miles with JVM technologies. Much better than Java, more concise, more joy, but still very heavy and overly verbose. More fun that Java, but still not as much fun as Rust or Go. Kotlin deployments were much larger than the others, so much was packaged in with them, but had very respectable performance.

So what was the test?

Once deployed, a quick bash script was created called api-cannon.sh that fired off three concurrent requests to each API Gateway endpoint, then slept for 5 seconds, and repeated for 50,000 iterations. With 5 endpoints, 50,000 iterations, and 3 concurrent requests per endpoint, we ended up with ~750,000 requests.

5 endpoints * 50,000 iterations * 3 concurrent requests per endpoint = ~750,000 requests

50,000 iterations * 5 seconds = ~3 days of continuous testing

All resources were deployed to the Oregon (us-west-2) region in AWS. The code executed in each project’s AWS Lambda handler was a very basic execution which resulted in simple JSON payloads being returned.

And the numbers are in

For average duration, ALL of them are freaking fast (< 10 ms) for this simple type of test, being similar to “hello world” response of a simple JSON payload. I’m also shocked that minimum duration's were possible of < .20 ms response times.

Also, if I’m being honest, I wanted Rust to do better. It didn’t do as well as I’d thought, but might be related to the BYOR scenario. The one thing it did do was be very steady: it had the least variation in performance, which could be a win for solutions requiring extremely predictable speeds.

Table format for duration’s captured during 3 days of testing

For average duration of AWS Lambda function execution, these are the data points. Both .NET Core languages were quite spiky in spots, but still turned in good times for averages. Go and Rust were as stead as Dr. Strange’s hands before his accident, and Kotlin only showed minor fluctuations.

Number call outs for average duration in benchmark tests
Sampling of line charts for average duration in benchmark tests

For maximum duration of AWS Lambda function execution, these are the data points. Both .NET Core languages showed big spikes in cold starts. Only Kotlin and .NET Core languages broke the > 1 s threshold for maximum response time. Go and Rust win here.

Number call outs for maximum duration in benchmark tests
Sampling of line charts for maximum duration in benchmark tests

For minimum duration of AWS Lambda function execution, these are the data points. I love how level these numbers are. All but Kotlin broke the < 1 ms floor threshold. Go and .NET Core languages took the cake here, but honestly these are all awesome to me and are imperceptible to the any users or things on the other side of a service.

Number call outs for minimum duration in benchmark tests
Sampling of line charts for minimum duration in benchmark tests

FIN/ACK

I’m also very happy with the lessons learned through my own testing, benchmarking. This round wasn’t perfect and there are some better tools out there to provide more meaningful data points; will be sharing those next time. I like knowing that I was in control of the code, that I knew exactly what code was executed. Next time, some CRUD operations against a DynamoDB backend will be introduced; some inter-connectivity with other AWS resources, too.

Continuous learner & technologist currently focused on building healthcare entities with forward-thinking partners. Passionate about all things Cloud.

At my day job, we’re working hard to promote continuous improvement, leading with culture, and planning for the future by being forward-thinking with our current talent. This sometimes means promoting unique individuals, teaching and mentoring others, or even removing ones that would likely thrive in another company. We call this “talent planning” and is what my mind has been focused on over the past few weeks (besides learning Golang and Machine Learning in AWS). I’ve jotted down a few verbal notes over the past few days and wanted to capture them as writ and share them here.

What are you doing to succeed in an overly-constrained environment (aka day 1 mindsets)?

Most of us…


This is the first in a multi-episode series of posts anchored on Azure and Terraform, partially to teach myself more about these services, and to also share with others that may be trying to build an Enterprise cloud environment from the ground up. If you’re interested in my opinions on the services involved, see this post: https://medium.com/@shouldroforion/azure-terraform-some-quick-observations-through-a-weekend-of-failfastshareoften-9bffc310c372.

Azure and Terraform in the Cloud.

We’ll start slow, then ramp up to a fully blown Enterprise cloud network with DevOps, serverless, and other cool marketing buzzwords. The project itself I’ve coined Project: High Charity, named after a pseudo-planet in my favorite sci-fi universe.

Find the entire project in…


In the spirit of continuous improvement, this weekend was focused on learning how to use Terraform with the Azure cloud platform. My professional career has taken me very close to orbit with AWS, CloudFormation, the Serverless.com framework for serverless development, and even Azure’s own Resource Manager templates for infrastructure management. I’ve tinkered with Pulumi, but nothing serious. That experience helped me to ramp up pretty quickly with Azure and Terraform so far.

Azure + Terraform = Awesome Sauce

In the spirit of continuous improvement, this weekend was focused on learning how to use Terraform with the Azure cloud platform. My professional career has taken me very…


Visual Studio Code + Go = Match Made in Heaven

Time to wrap up another weekend of continuous learning and improvement. I’ve been fascinated lately with Go due to it’s elegance and speed. It appeals to my roots of learning programming in C++ while in college, but feels elegant, simple modern, and crafted for cloud service excellence like a modern interpreted language or framework similar to Node.js or Python. I’m confident it will become my “go to” utility for years and projects to come.

I wanted to add some more depth to my serverless architecture skillset and improve my Go skills at the same time, so I decided to write…


We’ve been doing some experimentation with containers and Docker/Docker Swarm for some of our on-premise applications at work. I’ve only just touched Kubernetes, the apparent winner of the container orchestration and management battle in the infotech arena. Now having some real experience under my belt with Docker/Docker Swarm (though I’ve got a ton still to learn), I wanted to get some real experience with Kubernetes.

Over the past week and this weekend, I took the opportunity to dive deeper in to Kubernetes (k8s), specifically with Amazon EKS. This is the project I completed with the steps involved. The outputs of…