Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request includes several changes to improve the functionality and performance of the BigUInt and BigInt benchmarks and arithmetic operations. The most important changes include adding a new benchmark for the BigUInt
from_stringconstructor, modifying arithmetic functions to use a more efficient approach for handling word lists, and making adjustments to the BigInt initialization.New Benchmark Addition:
benches/biguint/bench_biguint_from_string.mojo: Added a comprehensive benchmark for the BigUIntfrom_stringconstructor, comparing its performance against Python's built-inint()constructor with 20 diverse test cases.Benchmark Command Updates:
benches/bigint/bench.mojoandbenches/biguint/bench.mojo: Updated the input prompt to ask for the name of the benchmark instead of the number, and added the newfromstrbenchmark option. [1] [2]Arithmetic Function Improvements:
src/decimojo/biguint/arithmetics.mojo: Modifiedadd,subtract,multiply,floor_divide, anddivmodfunctions to useList[UInt32]for word lists instead of initializing empty BigUInt objects, improving performance and memory usage. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]BigInt Initialization Adjustments:
src/decimojo/bigint/bigint.mojo: Adjusted the BigInt initialization to directly assign the magnitude using a list of words and updated thefrom_uint128method to useBigUInt.from_scalar. [1] [2] [3]