diff --git a/README.md b/README.md index 5b6d0d0b..ca2856dd 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 757e59d1..83b462da 100644 --- a/rust/lance-graph/README.md +++ b/rust/lance-graph/README.md @@ -127,69 +127,14 @@ 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 -Python bindings for this crate live under `python/src/graph.rs` and expose the same configuration and query APIs via PyO3. - -### Python Examples - -See top-level `examples/` for runnable Python examples: +See the Python package docs for setup and development: -- `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