Skip to content

Performance optimization - #48

Merged
str4d merged 1 commit into
str4d:mainfrom
PhilipCramer:performance-optimization
Sep 30, 2026
Merged

str4d merged 1 commit into
str4d:mainfrom
PhilipCramer:performance-optimization

Conversation

@PhilipCramer

Copy link
Copy Markdown

Changes

  • Replaced the loop based function pow(u32, usize) with the ones provided with num_traits::Pow
  • Updated dependencies and rust-version to get the build working consistently when running locally and in CI
  • Included Cargo.lock in git to ensure builds can be reproduced

Benchmark

Results from running on an Intel i5-1235U

Screenshot_20260110_005341

@str4d
str4d force-pushed the performance-optimization branch from 5190c0b to 0d53b74 Compare September 30, 2026 19:56

@str4d str4d left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 0d53b74. Thanks!

Comment thread src/ff1/alloc.rs

use super::{NumeralString, Operations};

fn pow(x: u32, e: usize) -> BigUint {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back in time to figure out why I had this separate function. I added this in 8f91862 when num-bigint 0.2.0 was the latest version at the time, and BigUint::pow did not exist (only BigUint::modpow).

@str4d
str4d merged commit e82ba0b into str4d:main Sep 30, 2026
9 checks passed
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