Skip to content

Conversation

@forfudan
Copy link
Owner

@forfudan forfudan commented Jul 7, 2025

This pull request introduces enhancements to the BigUInt benchmarks and arithmetic operations, focusing on subtraction benchmarks, SIMD optimizations, and new arithmetic methods. The changes improve performance, add comprehensive benchmarking capabilities, and refine the implementation of subtraction and addition operations.

SIMD Optimizations for Arithmetic Operations:

  • Introduced SIMD-based subtraction methods (subtract_simd) for improved performance, replacing traditional methods in subtract and subtract_inplace. (src/decimojo/biguint/arithmetics.mojo) [1] [2]
  • Added SIMD-based addition methods (add_simd) and optimized add_inplace with SIMD operations. (src/decimojo/biguint/arithmetics.mojo) [1] [2]

New Arithmetic Methods:

  • Added new methods for addition (add_slices) and multiplication (multiply_inplace_by_uint32), expanding functionality for BigUInt arithmetic. (src/decimojo/biguint/arithmetics.mojo) [1] [2]
  • Implemented normalize_carries to handle carry propagation efficiently during arithmetic operations. (src/decimojo/biguint/arithmetics.mojo) [1] [2]

Enhancements to BigUInt Benchmarks:

  • Added bench_biguint_subtraction module for benchmarking BigUInt subtraction against Python's int, including detailed logging and performance comparison across various test cases. (benches/biguint/bench_biguint_subtraction.mojo)
  • Updated benches/biguint/bench.mojo to include subtraction benchmarks in the menu and execution logic. (benches/biguint/bench.mojo) [1] [2] [3]

Bug Fixes and Refinements:

  • Fixed type mismatches in multiply_slices by ensuring consistent casting of BigUInt.BASE values. (src/decimojo/biguint/arithmetics.mojo)
  • Corrected a typo in the description of normalize_carries ("crray" → "carry"). (src/decimojo/biguint/arithmetics.mojo)

@forfudan forfudan merged commit d9bb737 into main Jul 7, 2025
1 check passed
@forfudan forfudan deleted the work branch July 7, 2025 21:41
forfudan added a commit that referenced this pull request Jul 7, 2025
forfudan added a commit that referenced this pull request Jul 7, 2025
forfudan added a commit that referenced this pull request Jul 9, 2025
forfudan added a commit that referenced this pull request Jul 9, 2025
forfudan added a commit that referenced this pull request Jul 11, 2025
forfudan added a commit that referenced this pull request Jul 14, 2025
forfudan added a commit that referenced this pull request Jul 15, 2025
forfudan added a commit that referenced this pull request Jul 18, 2025
forfudan added a commit that referenced this pull request Jul 24, 2025
forfudan added a commit that referenced this pull request Jul 26, 2025
forfudan added a commit that referenced this pull request Jul 31, 2025
forfudan added a commit that referenced this pull request Aug 3, 2025
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.

2 participants