Skip to content

Commit 0c44b81

Browse files
chore: clean up benchmarks (#1908)
- Put all guest programs for benchmarks into a shared workspace so the local openvm imports are clearer. - Switch all prove binaries to use the SdkVmConfig and parse it from openvm.toml - Added a QoL function `SdkVmConfig::from_toml -> AppConfig<SdkVmConfig>`
1 parent d572c40 commit 0c44b81

File tree

38 files changed

+209
-444
lines changed

38 files changed

+209
-444
lines changed

Cargo.lock

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ members = [
7070
"guest-libs/sha2/",
7171
"guest-libs/verify_stark/",
7272
]
73-
exclude = ["crates/sdk/example"]
73+
exclude = ["crates/sdk/example", "benchmarks/guest/**"]
7474
resolver = "2"
7575

7676
# Fastest runtime configuration

benchmarks/guest/Cargo.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[workspace.package]
2+
version = "0.0.0"
3+
edition = "2021"
4+
5+
[workspace]
6+
members = ["base64_json", "bincode", "bubblesort", "ecrecover", "factorial_iterative_u256", "fibonacci", "fibonacci_iterative", "fibonacci_recursive", "keccak256", "keccak256_iter", "kitchen-sink", "pairing", "quicksort", "regex", "revm_snailtracer", "revm_transfer", "rkyv", "sha256", "sha256_iter"]
7+
resolver = "2"
8+
9+
[workspace.dependencies]
10+
openvm = { path = "../../crates/toolchain/openvm" }
11+
openvm-algebra-guest = { path = "../../extensions/algebra/guest", default-features = false }
12+
openvm-ecc-guest = { path = "../../extensions/ecc/guest", default-features = false }
13+
openvm-keccak256 = { path = "../../guest-libs/keccak256/", default-features = false }
14+
openvm-ruint = { path = "../../guest-libs/ruint/", package = "ruint", default-features = false }
15+
openvm-pairing = { path = "../../guest-libs/pairing/", default-features = false }
16+
openvm-sha2 = { path = "../../guest-libs/sha2/", default-features = false }
17+
openvm-k256 = { path = "../../guest-libs/k256/", package = "k256" }
18+
openvm-p256 = { path = "../../guest-libs/p256/", package = "p256" }
19+
20+
# patch for ecrecover
21+
[patch.crates-io]
22+
k256 = { path = "../../guest-libs/k256/" }
23+
24+
[profile.release]
25+
panic = "abort"
26+
lto = "thin" # faster compile time
27+
28+
[profile.profiling]
29+
inherits = "release"
30+
debug = 2
31+
strip = false
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
[workspace]
21
[package]
3-
version = "0.1.0"
42
name = "openvm-json-program"
5-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
65

76
[dependencies]
8-
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] }
7+
openvm = { workspace = true, features = ["std"] }
98
base64 = { version = "0.22.1", default-features = false, features = ["alloc"] }
109
serde = { version = "1.0.214", default-features = false, features = ["derive"] }
1110
serde-json-core = "0.6.0"
1211

1312
[features]
1413
default = []
15-
16-
[profile.profiling]
17-
inherits = "release"
18-
debug = 2
19-
strip = false
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
[workspace]
21
[package]
32
name = "openvm-bincode-program"
4-
version = "0.0.0"
5-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
65

76
[dependencies]
8-
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] }
7+
openvm = { workspace = true, features = ["std"] }
98
bincode = { version = "2.0.0-rc.3", default-features = false, features = [
109
"derive",
1110
"alloc",
@@ -16,8 +15,3 @@ rand_pcg = "0.3.1"
1615

1716
[features]
1817
default = []
19-
20-
[profile.profiling]
21-
inherits = "release"
22-
debug = 2
23-
strip = false
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
[workspace]
21
[package]
32
name = "openvm-bubblesort-program"
4-
version = "0.0.0"
5-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
65

76
[dependencies]
8-
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] }
7+
openvm = { workspace = true, features = ["std"] }
98

109
[features]
1110
default = []
12-
13-
[profile.profiling]
14-
inherits = "release"
15-
debug = 2
16-
strip = false
Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
[workspace]
21
[package]
32
name = "openvm-ecdsa-recover-key-program"
4-
version = "0.0.0"
5-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
65

76
[dependencies]
8-
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] }
9-
openvm-algebra-guest = { path = "../../../extensions/algebra/guest", default-features = false }
10-
openvm-ecc-guest = { path = "../../../extensions/ecc/guest", default-features = false }
11-
openvm-keccak256 = { path = "../../../guest-libs/keccak256/", default-features = false }
7+
openvm = { workspace = true, features = ["std"] }
8+
openvm-algebra-guest.workspace = true
9+
openvm-ecc-guest.workspace = true
10+
openvm-keccak256.workspace = true
1211
revm-precompile = { git = "https://github.com/bluealloy/revm.git", tag = "v75", default-features = false }
1312
# IMPORTANT: must be same version as used by revm; revm does not re-export this feature so we enable it here
1413
alloy-primitives = { version = "1.2.0", default-features = false, features = [
@@ -18,15 +17,3 @@ k256 = { version = "0.13.3", default-features = false }
1817

1918
[features]
2019
default = []
21-
22-
[profile.release]
23-
panic = "abort"
24-
lto = "thin" # faster compile time
25-
26-
[profile.profiling]
27-
inherits = "release"
28-
debug = 2
29-
strip = false
30-
31-
[patch.crates-io]
32-
k256 = { path = "../../../guest-libs/k256/" }
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
[workspace]
21
[package]
32
name = "openvm-factorial-iterative-u256-program"
4-
version = "0.0.0"
5-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
65

76
[dependencies]
8-
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] }
9-
openvm-ruint = { path = "../../../guest-libs/ruint/", package = "ruint", default-features = false }
7+
openvm = { workspace = true, features = ["std"] }
8+
openvm-ruint.workspace = true
109

1110
[features]
1211
default = []
13-
14-
[profile.profiling]
15-
inherits = "release"
16-
debug = 2
17-
strip = false
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
[workspace]
21
[package]
32
name = "openvm-fibonacci-program"
4-
version = "0.0.0"
5-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
65

76
[dependencies]
8-
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] }
7+
openvm = { workspace = true, features = ["std"] }
98

109
[features]
1110
default = []
12-
13-
[profile.profiling]
14-
inherits = "release"
15-
debug = 2
16-
strip = false
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
[workspace]
21
[package]
32
name = "openvm-fibonacci-iterative-program"
4-
version = "0.0.0"
5-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
65

76
[dependencies]
8-
openvm = { path = "../../../crates/toolchain/openvm", features = ["std"] }
7+
openvm = { workspace = true, features = ["std"] }
98

109
[features]
1110
default = []
12-
13-
[profile.profiling]
14-
inherits = "release"
15-
debug = 2
16-
strip = false

0 commit comments

Comments
 (0)