Skip to content

Conversation

@silwol
Copy link

@silwol silwol commented Feb 27, 2023

Hey there,

After reading your blog post at https://www.confessionsofadataguy.com/aws-lambdas-python-vs-rust-performance-and-cost-savings/ I was surprised that the difference between Python and Rust was a lot less than I expected it judging by my previous experience.

I took a few moments to look at the code and found you're caching a lot of data multiple times, whereas Rust provides awesome capabilities to stream data through the process with iterators. In addition I found you're writing a file and reading it back where you could just write the compressed data directly to memory.

This MR contains a first commit that formats the code with rustfmt. My tooling does apply rustfmt automatically, so in order to keep the changes of the second commit easier to understand, I applied it first.

I'd be curious how the numbers of this slightly improved version compare to the numbers you published on your blog, and of course also how they compare to the Python version. This is of course just a few moments that I took to look at it, and I have close to no experience with Amazon services, so please bear with me if I did something wrong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant