Skip to content

Commit 41e62a5

Browse files
beinanclaude
andcommitted
refactor: move benchmarks to separate crate
Move benchmarks from lance-graph to a new lance-graph-bench crate to exclude them from release binaries and reduce build times. Changes: - Create new crate: lance-graph-bench (publish = false) - Move graph_execution benchmark to new crate - Remove benchmark-only dependencies from lance-graph: - criterion (benchmarking framework) - lance-index (unused) - Update workspace to include lance-graph-bench - Add README for benchmark crate Benefits: - Smaller release binaries (benchmark code excluded) - Faster production builds (benchmarks only built when needed) - Cleaner separation of concerns - All existing tests still pass (295 tests) Usage: cargo bench -p lance-graph-bench Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 34fb4f5 commit 41e62a5

6 files changed

Lines changed: 63 additions & 8 deletions

File tree

Cargo.lock

Lines changed: 14 additions & 2 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ members = [
33
"crates/lance-graph",
44
"crates/lance-graph-catalog",
55
"crates/lance-graph-python",
6+
"crates/lance-graph-bench",
67
]
78
resolver = "2"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "lance-graph-bench"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
description = "Benchmarks for lance-graph (not published)"
7+
8+
[dependencies]
9+
lance-graph = { path = "../lance-graph", version = "0.5.3" }
10+
lance = "1.0.0"
11+
arrow-array = "56.2"
12+
arrow-schema = "56.2"
13+
criterion = { version = "0.5", features = ["async", "async_tokio", "html_reports"] }
14+
futures = "0.3"
15+
tempfile = "3"
16+
tokio = { version = "1.37", features = ["macros", "rt-multi-thread"] }
17+
18+
[[bench]]
19+
name = "graph_execution"
20+
harness = false

crates/lance-graph-bench/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Lance Graph Benchmarks
2+
3+
Performance benchmarks for the `lance-graph` crate.
4+
5+
## Running Benchmarks
6+
7+
From the repository root:
8+
9+
```bash
10+
# Run all benchmarks
11+
cargo bench -p lance-graph-bench
12+
13+
# Run specific benchmark
14+
cargo bench -p lance-graph-bench --bench graph_execution
15+
```
16+
17+
## Benchmarks
18+
19+
- **graph_execution**: End-to-end query execution benchmarks
20+
- Basic node filtering and projection
21+
- Single-hop relationship expansion
22+
- Two-hop relationship expansion
23+
- Tests with datasets of varying sizes (100, 10K, 1M rows)
24+
25+
## Note
26+
27+
This crate is not published to crates.io and is excluded from releases.
28+
It exists solely for performance testing during development.
File renamed without changes.

crates/lance-graph/Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,7 @@ unity-catalog = ["lance-graph-catalog/unity-catalog"]
4747
delta = ["dep:deltalake", "dep:url"]
4848

4949
[dev-dependencies]
50-
criterion = { version = "0.5", features = ["async", "async_tokio", "html_reports"] }
5150
futures = "0.3"
5251
lance-arrow = "1.0.0"
53-
lance-index = "1.0.0"
5452
tempfile = "3"
5553
tokio = { version = "1.37", features = ["macros", "rt-multi-thread"] }
56-
57-
[[bench]]
58-
name = "graph_execution"
59-
harness = false

0 commit comments

Comments
 (0)