Performance benchmarks comparing dagron's Rust core against NetworkX on common DAG operations.
dagron's core graph engine is written in Rust (petgraph + PyO3), giving it a significant performance advantage over pure-Python graph libraries. This page presents representative benchmarks comparing dagron against NetworkX on equivalent operations.
All Python benchmarks below were measured with pytest-benchmark on a single machine. Rust-only benchmarks use Criterion. Numbers will vary by hardware — treat ratios as the meaningful signal.
Hardware: AMD Ryzen / Intel Core (modern x86_64), Linux, Python 3.12, dagron 0.1.0.
Last measured: March 2026.
Once the reachability index is built, dagron answers batch reachability queries ~3,900x faster than NetworkX's has_path (which re-traverses the graph each call).
Rust core releases the GIL. Every expensive operation in dagron runs inside py.allow_threads(), so the Rust code executes without Python interpreter overhead.
petgraph's adjacency list is cache-friendly. Nodes and edges are stored in contiguous arena-allocated vectors, giving excellent CPU cache behavior during traversals.
ahash beats Python dict overhead. Node name lookups use AHashMap — a fast, non-cryptographic hash map — instead of Python's general-purpose dict.