Skip to content
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

Refactor: Felt252 use lambdaworks field element #1184

Closed
wants to merge 107 commits into from
Closed

Conversation

pefontana
Copy link
Member

@pefontana pefontana commented May 29, 2023

TITLE

Description

Closes: #1197

This PR changes current Felt252 backend from num_bigint's FeltBigInt to lambdawork's FieldElement<Stark252PrimeField>.

Step by Step to benchmark lambdawork FieldElement:

Create binaries

mkdir binaries

Create binary from main

// Main las commit

git checkout de6a2327b7e629336bc2431787c8e28c3b0f1349 
cargo build -p cairo-vm-cli --release
mv target/release/cairo-vm-cli binaries/cairo-vm-cli-main

Create binary from lambdaworks-felt

cargo clean

// lambdaworks-felt last commit (cambiarlo con el ultimo commit)

git checkout 7dd7d58cabdb4861549149431db0461d965ec531 
cargo build -p cairo-vm-cli --release
mv target/release/cairo-vm-cli binaries/cairo-vm-cli-lambdaworks

Compile cairo program

Install dependencies if neesary

Linux users

make deps

Mac users

make deps-macos
source cairo-rs-env/bin/activate
make cairo_bench_programs

Run benchmarks

chmod +x lamdaworks-benchmarks.sh
sh lamdaworks-benchmarks.sh

@MegaRedHand MegaRedHand marked this pull request as ready for review June 8, 2023 14:09
@pefontana pefontana marked this pull request as draft June 14, 2023 19:39
felt/src/lib.rs Show resolved Hide resolved
@@ -2,6 +2,9 @@

#### Upcoming Changes

* feat: `Felt252` now uses _lambdaworks_' `FieldElement` internally
Copy link
Member

Choose a reason for hiding this comment

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

If it implements Copy now, add it to the changelog.

@MegaRedHand
Copy link
Contributor

Merged in d0804dd

@MegaRedHand MegaRedHand deleted the lambdaworks-felt branch June 28, 2023 13:06
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.

Use Lambdaworks FieldElement in Felt library
4 participants