Skip to content

Latest commit

ย 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CongraphDB Performance Benchmark v0.2.1

License: MIT Node.js Version Benchmark

A comprehensive benchmark suite comparing CongraphDB v0.2.1 against industry-standard graph and vector databases.

๐Ÿ“Š Live Results โ€ข Quick Start โ€ข Documentation โ€ข v0.2.1 Features


๐Ÿ“Š Quick Summary

Benchmark Metrics

Metric Description What It Measures
โšก Ingestion Rate Nodes/edges per second Write throughput & data loading performance
๐Ÿ” Query Latency k-hop traversal (1-5 hops) Graph navigation speed at varying depths
๐Ÿงฎ Algorithmic Throughput PageRank execution time Graph algorithm performance
๐Ÿ’พ Memory Footprint Peak RSS during operations Memory efficiency & resource usage
๐Ÿš€ Cold vs. Warm Start First query vs. cached Startup overhead & caching effectiveness

Test Scales

Scale Nodes Edges Use Case
๐Ÿ”น Small 10K 50K Quick testing & development
๐Ÿ”ธ Medium 100K 1M Standard production workload
๐Ÿ”บ Large 1M 10M Enterprise-scale scenarios

v0.2.1 Features

New in v0.2.1: Extended benchmarks for CongraphDB's hybrid engine, including parallel HNSW ingestion, batch vector search, and Graph RAG algorithms:

Benchmark Description Metrics
๐Ÿค– Vector Search Parallel HNSW ingestion & batch similarity search inserts/sec, search_latency_ms, recall
๐Ÿง  Graph RAG Fact/Entity retrieval & Graph algorithms ops/sec, traversal_depth, memory_rss
๐Ÿ”’ Transactions WAL durability & OCC concurrency overhead latency_ms, throughput_tps, recovery_time
๐Ÿ—„๏ธ Query Engine UNWIND & Parameterized query performance queries/sec, planning_time_ms
๐Ÿ“Š Algorithms PageRank, Leiden, Closeness, Louvain algorithm_time_ms, scaling_factor

Algorithm Benchmarks

Category Algorithms
Centrality PageRank, Betweenness, Closeness, Degree
Community Detection Louvain, Leiden, Spectral, SLPA, Infomap, Label Propagation
Traversal BFS, DFS, Dijkstra
Analytics Triangle Count, Connected Components, SCC

Running v0.1.13 Benchmarks

# Run all v0.1.13 benchmarks
npm run benchmark:v0113

# Run specific v0.1.13 benchmark
npm run benchmark:dml      # DML operations
npm run benchmark:api      # API comparison
npm run benchmark:vector   # Vector search (v0.1.x path)

# Run v0.2.1 Graph RAG benchmarks
npm run benchmark:v021     # All v0.2.1 benchmarks
npm run benchmark:rag      # Graph RAG specifically

New CLI Options (v0.2.1)

Option Description Default
--v021 Enable v0.2.1 benchmarks false
--v021-benchmarks <list> Comma-separated v0.2.1 benchmarks: graph-rag all

Legacy CLI Options

Option Description Default
--v0113 Enable v0.1.13 benchmarks false
--v0113-benchmarks <list> Comma-separated v0.1.13 benchmarks all

Overview

This benchmark validates CongraphDB's performance advantages as an Embedded Graph Database for Node.js applications.

๐Ÿ† Competitors

Database Type Language Architecture
CongraphDB ๐Ÿ†š Target TypeScript Embedded Graph DB
Neo4j Industry Standard Java Client-Server Graph DB
Kรนzu Embedded Graph C++ Embedded Graph DB
Graphology In-Memory JavaScript Pure-JS Graph Library
LevelGraph RDF Store JavaScript JS RDF Triple Store
Better-SQLite3 Relational C Embedded SQL Database

๐Ÿš€ Quick Start

# Install dependencies
npm install

# Run medium-scale benchmark with default engines
npm run benchmark

# Run specific scale
npm run benchmark:small   # 10k nodes / 50k edges
npm run benchmark:medium  # 100k nodes / 1M edges
npm run benchmark:large   # 1M nodes / 10M edges

# Run specific engines
node dist/cli.js run --engines congraph,neo4j,sqlite

# View help
node dist/cli.js run --help

Environment Setup

Neo4j (Optional)

To benchmark against Neo4j, you need a running Neo4j instance:

# Using Docker
docker run -d \
  --name neo4j \
  -p 7687:7687 -p 7474:7474 \
  -e NEO4J_AUTH=neo4j/your_password \
  neo4j:5.26-community

Then create a .env file:

NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=your_password

Kรนzu (Optional)

To benchmark against Kรนzu, install the Node.js bindings:

# Follow https://github.com/kuzudb/kuzu for installation instructions
npm install kuzu

๐Ÿ“ˆ Results

Interactive Documentation

Live Results

View interactive benchmark results with charts and visualizations

โœจ Features:

  • ๐Ÿ“Š Interactive charts for all metrics
  • ๐Ÿ† Performance leaderboard
  • โš–๏ธ Engine comparisons
  • ๐Ÿ“… Historical trends

๐Ÿ–ฅ๏ธ Local Documentation

# Serve documentation locally
npm run docs:serve

# Build documentation
npm run docs:build

# Deploy to GitHub Pages
npm run docs:deploy

Raw Results

Benchmark results are also saved to the results/ directory:

  • benchmark-*.json - Full results in JSON format
  • benchmark-*.csv - Summary results in CSV format

๐Ÿ… Leaderboard

Results from the latest benchmark run

๐Ÿ’ก Tip: Run npm run benchmark to generate fresh results!

Engine Scale โšก Ingestion ๐Ÿ” 1-hop ๐Ÿ” 3-hop ๐Ÿ” 5-hop ๐Ÿงฎ PageRank ๐Ÿ’พ Memory
CongraphDB Small 45,200/s 0.4ms 2.1ms 8.4ms 120ms 115MB
Neo4j Small 12,800/s 1.2ms 5.4ms 24.1ms 450ms 1.2GB
SQLite Small 8,500/s 0.8ms 8.2ms 45.3ms 1.8s 45MB
Kรนzu Small 38,400/s 0.5ms 2.5ms 10.2ms 180ms 180MB

๐Ÿค– Vector & Graph RAG Performance (v0.2.1)

Results for 100,000 vectors (1536-dim) on a 16-core workstation:

Operation Complexity CongraphDB (v0.2.1) Improvement
HNSW Ingestion Parallel 14,850 nodes/s 5.2x vs v0.1.x
Similarity Search k=10, ef=50 1.2ms 12x vs Cypher-only
Batch Search 100 queries 48ms 8.5x vs Sequential
Graph RAG Search Dual-Level 12.4ms New Feature
Context Retrieval 3-hop Paths 8.2ms Optimized Pathing

Architecture

congraphdb-benchmark/
โ”œโ”€โ”€ bin/                 # CLI entry point
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ engines/         # Database adapters
โ”‚   โ”‚   โ”œโ”€โ”€ congraph.ts  # CongraphDB adapter
โ”‚   โ”‚   โ”œโ”€โ”€ neo4j.ts     # Neo4j adapter
โ”‚   โ”‚   โ”œโ”€โ”€ kuzu.ts      # Kรนzu adapter
โ”‚   โ”‚   โ”œโ”€โ”€ sqlite.ts    # Better-SQLite3 adapter
โ”‚   โ”‚   โ”œโ”€โ”€ graphology.ts # Graphology adapter
โ”‚   โ”‚   โ””โ”€โ”€ levelgraph.ts # LevelGraph adapter
โ”‚   โ”œโ”€โ”€ benchmarks/      # v0.1.10 specialized benchmarks
โ”‚   โ”‚   โ”œโ”€โ”€ api-comparison.ts  # Cypher vs JavaScript API
โ”‚   โ”‚   โ”œโ”€โ”€ dml-operations.ts  # DML operations tests
โ”‚   โ”‚   โ”œโ”€โ”€ persistence.ts      # Storage mode tests
โ”‚   โ”‚   โ”œโ”€โ”€ statistics.ts       # Query statistics overhead
โ”‚   โ”‚   โ”œโ”€โ”€ vector-search.ts    # HNSW vector search benchmarks (NEW)
โ”‚   โ”‚   โ””โ”€โ”€ optimizer.ts        # Query optimizer benchmarks (NEW)
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ suite.ts     # Test suite executor
โ”‚   โ”‚   โ””โ”€โ”€ recorder.ts  # Metrics & export
โ”‚   โ””โ”€โ”€ data/
โ”‚       โ””โ”€โ”€ academic.ts  # Synthetic data generator
โ”œโ”€โ”€ docs/                # Interactive documentation
โ”‚   โ”œโ”€โ”€ index.md         # Landing page
โ”‚   โ”œโ”€โ”€ results/         # Results pages with charts
โ”‚   โ”œโ”€โ”€ engines/         # Engine comparisons
โ”‚   โ””โ”€โ”€ methodology/     # Testing methodology
โ”œโ”€โ”€ data/                # Benchmark data for docs
โ”‚   โ”œโ”€โ”€ latest.json      # Latest results
โ”‚   โ””โ”€โ”€ history.json     # Historical trends
โ”œโ”€โ”€ results/             # Benchmark output
โ”œโ”€โ”€ scripts/             # Documentation generation
โ”œโ”€โ”€ overrides/           # Custom styles/charts
โ””โ”€โ”€ .github/workflows/   # CI automation

Data Generation

The benchmark uses a Synthetic Academic Citation Network resembling the Cora/PubMed datasets:

  • Nodes: Papers with metadata (title, category, year, authors, venue)
  • Edges: Citation relationships with preferential attachment
  • Categories: AI, ML, DB, IR, CV, NLP

Contributing

When adding new engines or benchmarks:

  1. Implement the EngineAdapter interface in src/engines/
  2. Add the engine to the CLI parser in src/cli.ts
  3. Update this README with your results

License

MIT


Last updated: 2026-04-17 (v0.1.13)

Releases

Packages

Contributors

Languages