From 0f00bf850d1015d01427de701c168d3ffbac9926 Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Sat, 31 Aug 2024 03:13:41 +0900 Subject: [PATCH 1/2] increase dev mode opt-level for curve25519-dalek crate --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 6646127b161..26bd29309eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,9 @@ [profile.dev] split-debuginfo = "unpacked" +[profile.dev.package.curve25519-dalek] +opt-level = 3 + [workspace] members = [ "associated-token-account/client", From 3ea718cb382210c1fa1695f21aa53d4f17e23978 Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Sat, 31 Aug 2024 03:54:44 +0900 Subject: [PATCH 2/2] add comment to give context on bumping up the opt-level --- Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 26bd29309eb..c1ac36581f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,13 @@ [profile.dev] split-debuginfo = "unpacked" +# The curve25519-dalek crate 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 test environment. To give better performance in the solana-test-validator +# during tests and dev builds, override the opt-level to 3 for the crate. [profile.dev.package.curve25519-dalek] opt-level = 3