Skip to content

Commit bd6fd36

Browse files
refactor: move benchmarks to a new crate
1 parent 50d5667 commit bd6fd36

File tree

12 files changed

+44
-25
lines changed

12 files changed

+44
-25
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
resolver = "2"
3-
members = ["crates/powers-of-tau-util", "crates/proof-of-sql", "crates/proof-of-sql-parser", "crates/proof-of-sql-planner"]
3+
members = ["crates/powers-of-tau-util", "crates/proof-of-sql", "crates/proof-of-sql-benches", "crates/proof-of-sql-parser", "crates/proof-of-sql-planner"]
44

55
[workspace.package]
66
edition = "2021"
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[package]
2+
name = "proof-of-sql-benches"
3+
edition.workspace = true
4+
exclude.workspace = true
5+
repository.workspace = true
6+
version.workspace = true
7+
license-file.workspace = true
8+
9+
[dependencies]
10+
ark-serialize = { version = "0.5.0" }
11+
ark-std = { version = "0.5.0", default-features = false }
12+
blitzar = { version = "4.3.0" }
13+
bumpalo = { version = "3.11.0" }
14+
clap = { version = "4.5.4", features = ["derive", "env"] }
15+
criterion = { version = "0.5.1", features = ["html_reports"] }
16+
csv = { version = "1.3.1" }
17+
curve25519-dalek = { version = "4", features = ["rand_core"] }
18+
ff = { version = "0.13.0"}
19+
halo2curves = { version = "0.8.0", default-features = false }
20+
indexmap = { version = "2.8", default-features = false }
21+
nova-snark = { version = "0.41.0" }
22+
opentelemetry = { version = "0.23.0" }
23+
opentelemetry-jaeger = { version = "0.20.0" }
24+
proof-of-sql = { path = "../proof-of-sql", default-features = false, features = ["arrow", "hyperkzg_proof"] }
25+
rand = { version = "0.8", default-features = false }
26+
sqlparser = { version = "0.45.0", default-features = false }
27+
tracing = { version = "0.1.36", default-features = false }
28+
tracing-opentelemetry = { version = "0.22.0" }
29+
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
30+
31+
[lints]
32+
workspace = true
33+
34+
[[bench]]
35+
name = "bench_append_rows"
36+
harness = false

crates/proof-of-sql/benches/README.md renamed to crates/proof-of-sql-benches/src/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ The Jaeger benchmarks/tracing is wrapped by a binary. The motivation of the wrap
1010
```
1111
2. See all the options to run a benchmark.
1212
```bash
13-
cargo run --release --bin jaeger_benches --features="bench" -- --help
13+
cargo run --release --bin proof-of-sql-benches -- --help
1414
```
1515
3. Navigate to http://localhost:16686/ to see the results.
1616
4. To end the Jaeger service, run
1717
```bash
1818
docker kill jaeger
1919
```
2020

21-
All the options are outlined in the help and `jaeger_benches.rs` module.
21+
All the options are outlined in the help and `main.rs` module.
2222

2323
### Example
2424

2525
To run a benchmark on the `HyperKZG` commitment scheme using the `Single Column Filter` query with a table size of `1_000_000` for `3` iterations, your command would be the following.
2626

2727
```bash
28-
cargo run --release --bin jaeger_benches --features="bench" -- --s hyper-kzg -i 3 -t 1000000 -q single-column-filter
28+
cargo run --release --bin proof-of-sql-benches -- --s hyper-kzg -i 3 -t 1000000 -q single-column-filter
2929
```
3030

3131
### Memory logging (optional)
@@ -34,7 +34,7 @@ Jaeger benchmarks default to logging any traces at `DEBUG` level and above. Memo
3434

3535
Example
3636
```
37-
RUST_LOG=trace cargo bench -p proof-of-sql --bench jaeger_benches DynamicDory
37+
RUST_LOG=trace cargo run --release --bin proof-of-sql-benches
3838
```
3939
4040
## Criterion benchmarking
@@ -43,6 +43,6 @@ To run benchmarks with Criterion, you need to do the following
4343
4444
1. Run the benchmarks. (Warning: this takes a very long time.)
4545
```bash
46-
cargo bench -p proof-of-sql --bench bench_append_rows --features="test"
46+
cargo bench -p proof-of-sql-benches --bench bench_append_rows --features="test"
4747
```
4848
2. Navigate to `target/criterion/report/index.html` to see the results.

crates/proof-of-sql/benches/jaeger/bin/jaeger_benches.rs renamed to crates/proof-of-sql-benches/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! To run, execute the following commands:
44
//! ```bash
55
//! docker run --rm -d --name jaeger -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:1.62.0
6-
//! cargo run --release --bin jaeger_benches --features="bench" -- --help
6+
//! cargo run --release --bin proof-of-sql-benches -- --help
77
//! ```
88
//! Then, navigate to <http://localhost:16686> to view the traces.
99
//!

crates/proof-of-sql/Cargo.toml

+1-18
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ bumpalo = { workspace = true, features = ["collections"] }
3434
bytemuck = { workspace = true }
3535
byte-slice-cast = { workspace = true }
3636
clap = { workspace = true, features = ["derive", "env"], optional = true }
37-
csv = { workspace = true, optional = true }
3837
curve25519-dalek = { workspace = true, features = ["serde"] }
3938
chrono = { workspace = true, features = ["serde"] }
4039
derive_more = { workspace = true }
@@ -48,8 +47,6 @@ merlin = { workspace = true, optional = true }
4847
nova-snark = { workspace = true, optional = true }
4948
num-traits = { workspace = true }
5049
num-bigint = { workspace = true, default-features = false }
51-
opentelemetry = { workspace = true, optional = true }
52-
opentelemetry-jaeger = { workspace = true, optional = true }
5350
postcard = { workspace = true, features = ["alloc"] }
5451
proof-of-sql-parser = { workspace = true }
5552
rand = { workspace = true, default-features = false, optional = true }
@@ -64,13 +61,10 @@ sysinfo = {workspace = true, optional = true }
6461
tempfile = { workspace = true, optional = true }
6562
tiny-keccak = { workspace = true }
6663
tracing = { workspace = true, features = ["attributes"] }
67-
tracing-opentelemetry = { workspace = true, optional = true }
68-
tracing-subscriber = { workspace = true, optional = true }
6964
zerocopy = { workspace = true }
7065

7166
[dev-dependencies]
7267
arrow-csv = { workspace = true }
73-
criterion = { workspace = true, features = ["html_reports"] }
7468
hex = { workspace = true }
7569
merlin = { workspace = true }
7670
rand = { workspace = true, default-features = false, features = ["std"] }
@@ -82,13 +76,12 @@ proptest = { workspace = true }
8276
proptest-derive = { workspace = true }
8377

8478
[package.metadata.cargo-udeps.ignore]
85-
development = ["arrow-csv", "criterion", "opentelemetry", "opentelemetry-jaeger", "tracing-opentelemetry", "tracing-subscriber"]
79+
development = ["arrow-csv"]
8680

8781
[features]
8882
default = ["arrow", "perf"]
8983
utils = ["dep:indicatif", "dep:rand_chacha", "dep:sha2", "dep:clap", "dep:tempfile"]
9084
arrow = ["dep:arrow", "std"]
91-
bench = ["blitzar", "dep:clap", "csv", "dep:rand", "hyperkzg_proof", "opentelemetry", "opentelemetry-jaeger", "std", "tracing-opentelemetry", "tracing-subscriber" ]
9285
blitzar = ["dep:blitzar", "dep:merlin", "std"]
9386
hyperkzg_proof = ["dep:nova-snark", "std", "dep:ff", "dep:halo2curves", "blitzar"]
9487
test = ["dep:rand", "std"]
@@ -110,11 +103,6 @@ name = "commitment-utility"
110103
path = "utils/commitment-utility/main.rs"
111104
required-features = [ "std", "blitzar", "utils" ]
112105

113-
[[bin]]
114-
name = "jaeger_benches"
115-
path = "benches/jaeger/bin/jaeger_benches.rs"
116-
required-features = [ "bench" ]
117-
118106
[[example]]
119107
name = "hello_world"
120108
required-features = ["test"]
@@ -190,8 +178,3 @@ required-features = [ "arrow" ]
190178
[[example]]
191179
name = "rockets"
192180
required-features = [ "arrow" ]
193-
194-
[[bench]]
195-
name = "bench_append_rows"
196-
harness = false
197-
required-features = ["test"]

0 commit comments

Comments
 (0)