Skip to content

Commit 33e4fba

Browse files
authored
docs: move Benchmarks section to root README and link from rust crate (#9)
* docs: move Benchmarks section to root README and link from rust crate * docs: move Python bindings details to python/README and link from Rust README
1 parent d6a5ec9 commit 33e4fba

2 files changed

Lines changed: 39 additions & 59 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,38 @@ pytest python/tests/test_graph.py::test_basic_node_selection -v
7979

8080
The Python README (`python/README.md`) contains additional details if you are
8181
working solely on the bindings.
82+
83+
## Benchmarks
84+
85+
- Requirements:
86+
- protoc: install `protobuf-compiler` (Debian/Ubuntu: `sudo apt-get install -y protobuf-compiler`).
87+
- Optional: gnuplot for Criterion's gnuplot backend; otherwise the plotters backend is used.
88+
89+
- Run (from `rust/lance-graph`):
90+
91+
```bash
92+
cargo bench --bench graph_execution
93+
94+
# Quicker local run (shorter warm-up/measurement):
95+
cargo bench --bench graph_execution -- --warm-up-time 1 --measurement-time 2 --sample-size 10
96+
```
97+
98+
- Reports:
99+
- Global index: `rust/lance-graph/target/criterion/report/index.html`
100+
- Group index: `rust/lance-graph/target/criterion/cypher_execution/report/index.html`
101+
102+
- Typical results (x86_64, quick run: warm-up 1s, measurement 2s, sample size 10):
103+
104+
| Benchmark | Size | Median time | Approx. throughput |
105+
|--------------------------|-----------|-------------|--------------------|
106+
| basic_node_filter | 100 | ~680 µs | ~147 Kelem/s |
107+
| basic_node_filter | 10,000 | ~715 µs | ~13.98 Melem/s |
108+
| basic_node_filter | 1,000,000 | ~743 µs | ~1.35 Gelem/s |
109+
| single_hop_expand | 100 | ~2.79 ms | ~35.9 Kelem/s |
110+
| single_hop_expand | 10,000 | ~3.77 ms | ~2.65 Melem/s |
111+
| single_hop_expand | 1,000,000 | ~3.70 ms | ~270 Melem/s |
112+
| two_hop_expand | 100 | ~4.52 ms | ~22.1 Kelem/s |
113+
| two_hop_expand | 10,000 | ~6.41 ms | ~1.56 Melem/s |
114+
| two_hop_expand | 1,000,000 | ~6.16 ms | ~162 Melem/s |
115+
116+
Numbers are illustrative; your hardware, compiler, and runtime load will affect results.

rust/lance-graph/README.md

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -127,69 +127,14 @@ cargo test -p lance-graph
127127

128128
## Benchmarks
129129

130-
- **Requirements**:
131-
- **protoc**: install `protobuf-compiler` (Debian/Ubuntu: `sudo apt-get install -y protobuf-compiler`).
132-
- Optional: **gnuplot** for Criterion's gnuplot backend; otherwise the plotters backend is used.
133-
134-
- **Run** (from `rust/lance-graph`):
135-
136-
```bash
137-
cargo bench --bench graph_execution
138-
139-
# Quicker local run (shorter warm-up/measurement):
140-
cargo bench --bench graph_execution -- --warm-up-time 1 --measurement-time 2 --sample-size 10
141-
```
142-
143-
- **Reports**:
144-
- Global index: `rust/lance-graph/target/criterion/report/index.html`
145-
- Group index: `rust/lance-graph/target/criterion/cypher_execution/report/index.html`
146-
147-
- **Typical results** (x86_64, quick run: warm-up 1s, measurement 2s, sample size 10):
148-
149-
| Benchmark | Size | Median time | Approx. throughput |
150-
|-------------------------------------|-----------|-------------|--------------------|
151-
| `basic_node_filter` | 100 | ~680 µs | ~147 Kelem/s |
152-
| `basic_node_filter` | 10,000 | ~715 µs | ~13.98 Melem/s |
153-
| `basic_node_filter` | 1,000,000 | ~743 µs | ~1.35 Gelem/s |
154-
| `single_hop_expand` | 100 | ~2.79 ms | ~35.9 Kelem/s |
155-
| `single_hop_expand` | 10,000 | ~3.77 ms | ~2.65 Melem/s |
156-
| `single_hop_expand` | 1,000,000 | ~3.70 ms | ~270 Melem/s |
157-
| `two_hop_expand` | 100 | ~4.52 ms | ~22.1 Kelem/s |
158-
| `two_hop_expand` | 10,000 | ~6.41 ms | ~1.56 Melem/s |
159-
| `two_hop_expand` | 1,000,000 | ~6.16 ms | ~162 Melem/s |
160-
161-
Numbers are illustrative; your hardware, compiler, and runtime load will affect results.
130+
See the repository root `README.md` for benchmark setup, run commands, and report locations.
162131

163132
## Python Bindings
164133

165-
Python bindings for this crate live under `python/src/graph.rs` and expose the same configuration and query APIs via PyO3.
166-
167-
### Python Examples
168-
169-
See top-level `examples/` for runnable Python examples:
134+
See the Python package docs for setup and development:
170135

171-
- `basic_cypher.py`: simple node filter and projection against in-memory Arrow batches.
172-
- `kg_traversal.py`: two-hop traversal on a small synthetic knowledge graph.
173-
174-
Setup and run (from repo root):
175-
176-
```bash
177-
Option A - Local build (editable):
178-
179-
```bash
180-
maturin develop -m python/Cargo.toml
181-
python examples/basic_cypher.py
182-
python examples/kg_traversal.py
183-
```
184-
185-
Option B - Using uv:
186-
187-
```bash
188-
uvx --from maturin maturin develop -m python/Cargo.toml
189-
uv run --with pyarrow python examples/basic_cypher.py
190-
uv run --with pyarrow python examples/kg_traversal.py
191-
```
192-
```
136+
- Python package README: `python/README.md`
137+
- Runnable examples (from repo root): `examples/README.md`
193138

194139
## License
195140

0 commit comments

Comments
 (0)