Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Increase dev mode opt-level for curve25519-dalek crate #7220

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

samkim-crypto
Copy link
Contributor

@samkim-crypto samkim-crypto commented Aug 30, 2024

Problem

The curve25519-dalek crate could be quite slow on development mode relative to release mode. This could result in some tests failing (e.g. anza-xyz/agave#2252).

Summary of Changes

Bump up the opt-level for the crate in Cargo.

@samkim-crypto samkim-crypto marked this pull request as ready for review August 30, 2024 18:28
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks good to me! Can you just add a comment about why this is included? Maybe something like:

curve25519-dalek uses the `simd` backend by default in v4 if possible, which has very slow performance on some platforms with opt-level 0, which is the default for `dev` and `test` builds. This slowdown causes certain interactions in the solana-test-validator, such as verifying ZK proofs in transactions, to take much more than 400ms, creating problems in the testing environment.
To give better performance in solana-test-validator during tests and dev builds, we override the opt-level to 3 for the crate.

@samkim-crypto samkim-crypto merged commit f5d0605 into solana-labs:master Aug 30, 2024
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants