From 8082cab9be7df63a60589d58a6a851bba785ca12 Mon Sep 17 00:00:00 2001 From: beinan Date: Thu, 16 Oct 2025 06:39:31 +0000 Subject: [PATCH 1/2] docs: move Benchmarks section to root README and link from rust crate --- README.md | 35 +++++++++++++++++++++++++++++++++++ rust/lance-graph/README.md | 33 +-------------------------------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 5b6d0d0bd..ca2856ddf 100644 --- a/README.md +++ b/README.md @@ -79,3 +79,38 @@ pytest python/tests/test_graph.py::test_basic_node_selection -v The Python README (`python/README.md`) contains additional details if you are working solely on the bindings. + +## Benchmarks + +- Requirements: + - protoc: install `protobuf-compiler` (Debian/Ubuntu: `sudo apt-get install -y protobuf-compiler`). + - Optional: gnuplot for Criterion's gnuplot backend; otherwise the plotters backend is used. + +- Run (from `rust/lance-graph`): + +```bash +cargo bench --bench graph_execution + +# Quicker local run (shorter warm-up/measurement): +cargo bench --bench graph_execution -- --warm-up-time 1 --measurement-time 2 --sample-size 10 +``` + +- Reports: + - Global index: `rust/lance-graph/target/criterion/report/index.html` + - Group index: `rust/lance-graph/target/criterion/cypher_execution/report/index.html` + +- Typical results (x86_64, quick run: warm-up 1s, measurement 2s, sample size 10): + +| Benchmark | Size | Median time | Approx. throughput | +|--------------------------|-----------|-------------|--------------------| +| basic_node_filter | 100 | ~680 µs | ~147 Kelem/s | +| basic_node_filter | 10,000 | ~715 µs | ~13.98 Melem/s | +| basic_node_filter | 1,000,000 | ~743 µs | ~1.35 Gelem/s | +| single_hop_expand | 100 | ~2.79 ms | ~35.9 Kelem/s | +| single_hop_expand | 10,000 | ~3.77 ms | ~2.65 Melem/s | +| single_hop_expand | 1,000,000 | ~3.70 ms | ~270 Melem/s | +| two_hop_expand | 100 | ~4.52 ms | ~22.1 Kelem/s | +| two_hop_expand | 10,000 | ~6.41 ms | ~1.56 Melem/s | +| two_hop_expand | 1,000,000 | ~6.16 ms | ~162 Melem/s | + +Numbers are illustrative; your hardware, compiler, and runtime load will affect results. diff --git a/rust/lance-graph/README.md b/rust/lance-graph/README.md index 757e59d1e..bd601b744 100644 --- a/rust/lance-graph/README.md +++ b/rust/lance-graph/README.md @@ -127,38 +127,7 @@ cargo test -p lance-graph ## Benchmarks -- **Requirements**: - - **protoc**: install `protobuf-compiler` (Debian/Ubuntu: `sudo apt-get install -y protobuf-compiler`). - - Optional: **gnuplot** for Criterion's gnuplot backend; otherwise the plotters backend is used. - -- **Run** (from `rust/lance-graph`): - -```bash -cargo bench --bench graph_execution - -# Quicker local run (shorter warm-up/measurement): -cargo bench --bench graph_execution -- --warm-up-time 1 --measurement-time 2 --sample-size 10 -``` - -- **Reports**: - - Global index: `rust/lance-graph/target/criterion/report/index.html` - - Group index: `rust/lance-graph/target/criterion/cypher_execution/report/index.html` - -- **Typical results** (x86_64, quick run: warm-up 1s, measurement 2s, sample size 10): - -| Benchmark | Size | Median time | Approx. throughput | -|-------------------------------------|-----------|-------------|--------------------| -| `basic_node_filter` | 100 | ~680 µs | ~147 Kelem/s | -| `basic_node_filter` | 10,000 | ~715 µs | ~13.98 Melem/s | -| `basic_node_filter` | 1,000,000 | ~743 µs | ~1.35 Gelem/s | -| `single_hop_expand` | 100 | ~2.79 ms | ~35.9 Kelem/s | -| `single_hop_expand` | 10,000 | ~3.77 ms | ~2.65 Melem/s | -| `single_hop_expand` | 1,000,000 | ~3.70 ms | ~270 Melem/s | -| `two_hop_expand` | 100 | ~4.52 ms | ~22.1 Kelem/s | -| `two_hop_expand` | 10,000 | ~6.41 ms | ~1.56 Melem/s | -| `two_hop_expand` | 1,000,000 | ~6.16 ms | ~162 Melem/s | - -Numbers are illustrative; your hardware, compiler, and runtime load will affect results. +See the repository root `README.md` for benchmark setup, run commands, and report locations. ## Python Bindings From 0180185f9993a712fd90cf84854ed5bf4d24c394 Mon Sep 17 00:00:00 2001 From: beinan Date: Thu, 16 Oct 2025 06:35:01 +0000 Subject: [PATCH 2/2] docs: move Python bindings details to python/README and link from Rust README --- rust/lance-graph/README.md | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/rust/lance-graph/README.md b/rust/lance-graph/README.md index bd601b744..83b462da2 100644 --- a/rust/lance-graph/README.md +++ b/rust/lance-graph/README.md @@ -131,34 +131,10 @@ See the repository root `README.md` for benchmark setup, run commands, and repor ## Python Bindings -Python bindings for this crate live under `python/src/graph.rs` and expose the same configuration and query APIs via PyO3. +See the Python package docs for setup and development: -### Python Examples - -See top-level `examples/` for runnable Python examples: - -- `basic_cypher.py`: simple node filter and projection against in-memory Arrow batches. -- `kg_traversal.py`: two-hop traversal on a small synthetic knowledge graph. - -Setup and run (from repo root): - -```bash -Option A - Local build (editable): - -```bash -maturin develop -m python/Cargo.toml -python examples/basic_cypher.py -python examples/kg_traversal.py -``` - -Option B - Using uv: - -```bash -uvx --from maturin maturin develop -m python/Cargo.toml -uv run --with pyarrow python examples/basic_cypher.py -uv run --with pyarrow python examples/kg_traversal.py -``` -``` +- Python package README: `python/README.md` +- Runnable examples (from repo root): `examples/README.md` ## License