Skip to content

SurrealDb vs RocksDb#71

Open
andrussal wants to merge 3 commits into
masterfrom
surrealdb
Open

SurrealDb vs RocksDb#71
andrussal wants to merge 3 commits into
masterfrom
surrealdb

Conversation

@andrussal
Copy link
Copy Markdown

@andrussal andrussal commented May 1, 2025

Set of benchmarks to compare SurrealDb and RocksDb performance. Each test inserts specified number of blocks to database and then runs queries.

RocksDb benches:

  1. Get all blocks
  2. Get blocks by following parent pointers

SurrealDb benches

  1. Get all blocks
  2. Get blocks by following parent pointers(without graph edges)
  3. Get blocks by following parent pointers following graph edges

Results on my laptop

----------------------------------------
[BENCHMARK START] SURREALDB SELECT ALL
[BENCHMARK SETUP] 1000000 BLOCKS TOOK 16.206164541s
[BENCHMARK RESULT] SELECTING 1000000 BLOCKS TOOK 1.914452333s
----------------------------------------

----------------------------------------
[BENCHMARK START] SURREALDB PARENT-TO-CHILD GRAPH
[BENCHMARK SETUP] 1000000 BLOCKS (INCLUDING EDGES) TOOK 47.100607041s
[BENCHMARK RESULT] PARENT-TO-CHILD TRAVERSAL (1000000 BLOCKS) TOOK 53.866185375s
----------------------------------------

----------------------------------------
[BENCHMARK START] SURREALDB PARENT-TO-CHILD POINTER
[BENCHMARK SETUP] 1000000 BLOCKS (WITHOUT EDGES) TOOK 16.288874375s
[BENCHMARK RESULT] PARENT-TO-CHILD TRAVERSAL (1000000 BLOCKS) TOOK 17.978471792s
----------------------------------------

----------------------------------------
[BENCHMARK START] ROCKSDB SELECT ALL
[BENCHMARK SETUP] 1000000 BLOCKS TOOK 304.756708ms
[BENCHMARK RESULT] SELECTING 1000000 BLOCKS TOOK 157.398417ms
----------------------------------------

----------------------------------------
[BENCHMARK START] ROCKSDB PARENT-TO-CHILD
[BENCHMARK SETUP] 1000000 BLOCKS TOOK 319.386125ms
[BENCHMARK RESULT] PARENT-TO-CHILD TRAVERSAL (1000000 BLOCKS) TOOK: 603.345333ms
----------------------------------------

SINGLE ENTRY BENCHMARK RESULTS

Running benchmarks with blocks_count=1
----------------------------------------
[BENCHMARK START] SURREALDB SELECT ALL
[BENCHMARK SETUP] 1 BLOCKS TOOK 1.134042ms
[BENCHMARK RESULT] SELECTING 1 BLOCKS TOOK 321.125µs
----------------------------------------

----------------------------------------
[BENCHMARK START] SURREALDB PARENT-TO-CHILD GRAPH
[BENCHMARK SETUP] 1 BLOCKS (INCLUDING EDGES) TOOK 1.21125ms
[BENCHMARK RESULT] PARENT-TO-CHILD TRAVERSAL (1 BLOCKS) TOOK 519.542µs
----------------------------------------

----------------------------------------
[BENCHMARK START] SURREALDB PARENT-TO-CHILD POINTER
[BENCHMARK SETUP] 1 BLOCKS (WITHOUT EDGES) TOOK 1.259917ms
[BENCHMARK RESULT] PARENT-TO-CHILD TRAVERSAL (1 BLOCKS) TOOK 230.792µs
----------------------------------------

----------------------------------------
[BENCHMARK START] ROCKSDB SELECT ALL
[BENCHMARK SETUP] 1 BLOCKS TOOK 134.875µs
[BENCHMARK RESULT] SELECTING 1 BLOCKS TOOK 49µs
----------------------------------------

----------------------------------------
[BENCHMARK START] ROCKSDB PARENT-TO-CHILD
[BENCHMARK SETUP] 1 BLOCKS TOOK 102.875µs
[BENCHMARK RESULT] PARENT-TO-CHILD TRAVERSAL (1 BLOCKS) TOOK: 25.875µs

@andrussal andrussal requested a review from strinnityk May 1, 2025 14:15
@andrussal andrussal requested a review from danielSanchezQ May 12, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant