-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance improvements - new return types in rust #57
Conversation
This reverts commit bbb332f.
…... should be faster ...
Reviewer's Guide by SourceryThis pull request introduces significant performance improvements by changing the return types in the Rust implementation of the FizzBuzz library. The File-Level Changes
Tips
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @MusicalNinjaDad - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 7 issues found
- 🟢 Security: all looks good
- 🟡 Testing: 3 issues found
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
@@ -32,7 +33,9 @@ macro_rules! test_this { | |||
} | |||
|
|||
/// Test all compatible standard types | |||
mod standard_types { | |||
mod standard_types_up_to_127_as_strings { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (testing): Add tests for boundary values
It would be useful to add tests for boundary values such as 0, 1, and the maximum values for each type to ensure the new return types handle these correctly.
Rust 4.0.0 & Python 3.0.1
MultiFizzBuzz
now lazily returns a rayon IndexedParallelIteratorFizzBuzz
returns aFizzBuzzAnswer
which can be converted into aString
orCow<str>
FizzBuzzAnswer
now represents the valid answers to FizzBuzz, notOne(String)
orMany(Vec>String>)
Summary by Sourcery
This pull request introduces significant performance improvements by updating the return types for
FizzBuzz
andMultiFizzBuzz
. TheFizzBuzzAnswer
enum has been refactored to directly represent valid FizzBuzz answers. The Python implementation has been updated to work with Rust v4.0.0, bringing slight performance improvements. Documentation and tests have been updated accordingly.FizzBuzz
andMultiFizzBuzz
to improve performance, including lazy evaluation withrayon::iter::IndexedParallelIterator
.FizzBuzzAnswer
to represent valid FizzBuzz answers directly, removing the need forOne(String)
andMany(Vec<String>)
variants.FizzBuzz
andMultiFizzBuzz
.FizzBuzzAnswer
andMultiFizzBuzz
implementations, including tests for negative numbers and non-whole numbers.