Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 applyrustfmt
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.