Skip to Content
TutorialsBenchmark NeuG: The Dual-Mode Graph Database

Benchmark NeuG: The Dual-Mode Graph Database

This tutorial demonstrates how to reproduce NeuG’s benchmark performance results. NeuG supports two execution modes:

  • Embedded Mode: Run queries directly in your Python process with zero serialization overhead
  • Service Mode: Connect to a NeuG server for concurrent transactional workloads

We benchmark both modes against industry-standard databases to showcase NeuG’s performance advantages.

Note: The LDBC SNB Interactive benchmark section covers only the complex read queries (IC1–IC14). It does not include write operations and transactional updates. A full LDBC SNB Interactive benchmark tutorial will be provided in a future release.

Dataset: LDBC SNB SF1

Both benchmarks use the same LDBC SNB SF1 dataset:

  • Nodes: ~3 million (Person, Post, Comment, Tag, etc.)
  • Edges: ~17 million (KNOWS, LIKES, HASTAG, etc.)
  • Size: ~282MB compressed, ~1.1GB extracted

Download the Dataset

wget https://neug.oss-cn-hangzhou.aliyuncs.com/datasets/ldbc-snb-sf1-lsqb.tar.gz tar -xzf ldbc-snb-sf1-lsqb.tar.gz

LSQB Benchmark (Embedded Mode)

LSQB  contains 9 complex subgraph matching queries that lean toward analytical workloads. This benchmark compares NeuG with LadybugDB in embedded mode.

Note on KNOWS Edges: The original LSQB benchmark assumes KNOWS relationships are bidirectional (i.e., if A knows B, then B also knows A). In our tests, we modified all queries involving KNOWS edges to use directed traversal (-[:KNOWS]->). This adjustment allows the same LDBC SNB SF1 dataset to be used for both SNB Interactive and LSQB benchmarks, since the KNOWS relationships in the original LDBC SNB data are unidirectional. This modification does not affect the fairness of evaluating graph database query optimization and execution capabilities.

Query Descriptions

QueryDescription
Q1Long path traversal (9-hop chain)
Q22-hop with comment-post pattern
Q3Triangle pattern in same country
Q4Multi-label with likes/replies
Q5Tag co-occurrence via comments
Q62-hop with interest tags
Q7Optional matches for likes/replies
Q8Tag pattern with NOT EXISTS
Q92-hop with NOT EXISTS

Running the Benchmark

# Create virtual environment python -m venv neug-env source neug-env/bin/activate # Install dependencies pip install neug real_ladybug # Run the benchmark cd neug/examples/lsqb_benchmark python run_benchmark.py --data-dir /path/to/ldbc-snb-sf1-lsqb

Use --force to overwrite an existing database.

Expected Results

On Apple Silicon Mac (M1/M2/M3), NeuG wins 8 out of 9 queries with just a single thread, even when comparing against LadybugDB’s best multi-threaded result:

QueryNeuG (1 thread)LadybugDB (best)Winner
Q12.60s60.24s (4t)NeuG 23.2x
Q20.14s12.69s (8t)NeuG 90.6x
Q30.37s106.22s (2t)NeuG 287.1x
Q40.14s1.24s (8t)NeuG 8.9x
Q50.83s5.72s (8t)NeuG 6.9x
Q60.48s0.15s (4t)Ladybug 3.2x
Q70.58s4.91s (8t)NeuG 8.5x
Q80.71s7.09s (8t)NeuG 10.0x
Q90.60s1.02s (8t)NeuG 1.7x

NeuG excels on complex join-heavy queries, achieving dramatic speedups up to 287x on triangle patterns (Q3) and 91x on multi-hop filtering (Q2). LadybugDB’s multi-threading advantage shows on simpler traversal queries like Q6.


LDBC SNB Interactive Benchmark (Service Mode)

LDBC SNB Interactive  contains 14 complex read queries (IC1–IC14) covering multi-hop friend finding, shortest paths, and aggregation. This benchmark compares NeuG with Neo4j in service mode.

Query Descriptions

QueryDescription
IC1Friends with specific first name (up to 3 hops)
IC2Recent messages from friends
IC3Friends with messages in two countries
IC4Messages with specific tags in time range
IC5Forums with most friend members
IC6Friends with tagged posts
IC7Recent likes on messages
IC8Recent replies on messages
IC9Recent messages from friends of friends
IC10Friends with same birthday month
IC11Friends working in specific country
IC12Friends with specific tag class interests
IC13Shortest path between two persons
IC14Weighted shortest path between two persons

Running the Benchmark

# Start Neo4j server (optional, for comparison) docker run -d --name neo4j \ -p 7474:7474 -p 7687:7687 \ -e NEO4J_AUTH=neo4j/neo4j123 \ neo4j:latest # Create virtual environment python -m venv neug-env source neug-env/bin/activate # Install dependencies pip install neug neo4j # Run the benchmark cd neug/examples/ldbc_interactive_benchmark python run_benchmark.py --data-dir /path/to/ldbc-snb-sf1-lsqb

Expected Results

On Apple Silicon Mac (M1/M2/M3), with 4 concurrent clients for 300 seconds:

Throughput Comparison

EngineQPSP50 LatencyP95 LatencyTotal Queries
NeuG6173.1 ms20.6 ms185,156
Neo4j12.216.0 ms1,728 ms3,659

NeuG achieves 50.6x the throughput of Neo4j. On latency, NeuG’s P95 is just 20.6ms while Neo4j’s P95 reaches 1,728ms.

Per-Query Latency (P50 ms)

QueryNeuGNeo4jNeuG Wins
IC16.25.2-
IC23.28.42.6x
IC311.1984.489x
IC410.98.0-
IC522.31892.485x
IC62.7423.0159x
IC74.54.0-
IC82.41.0-
IC93.9829.8212x
IC105.384.216x
IC112.46.62.7x
IC123.918.84.8x
IC130.40.82x
IC144.5185.241x

NeuG wins on 10 out of 14 queries, with dramatic speedups on complex multi-hop and aggregation queries.


Why NeuG is Faster

NeuG’s performance advantage comes from:

Embedded Mode Advantages

  1. Graph-native query optimizer: GOpt  performs cost-based optimization with graph-specific cardinality estimation.

  2. Columnar vectorized execution: Efficient memory management and cache-friendly traversals.

  3. Zero serialization overhead: Executes in-process with direct memory access.

Service Mode Advantages

  1. MVCC concurrency control: Efficient handling of concurrent transactions without blocking reads.

  2. Battle-tested engine: NeuG is built on GraphScope Flex , the engine that set the LDBC SNB Interactive world record  at 80,000+ QPS.


Reproducibility

All performance results are independently reproducible:

If you encounter any issues reproducing these results, please report them on GitHub Issues .