Skip to content

Instantly share code, notes, and snippets.

@patx
Created January 6, 2025 23:34
Show Gist options
  • Select an option

  • Save patx/fbe42aab9f0bfcef6f16e30f3aed76df to your computer and use it in GitHub Desktop.

Select an option

Save patx/fbe42aab9f0bfcef6f16e30f3aed76df to your computer and use it in GitHub Desktop.
Test Results Summary
JsonDB
1,000,000 records:
Insertion: 1.57s
Retrieval: 0.73s
Dump: 1.24s
Total: 3.55s
10,000,000 records:
Insertion: 18.34s
Retrieval: 8.79s
Dump: 12.74s
Total: 40.07s
20,000,000 records:
Insertion: 35.96s
Retrieval: 18.46s
Dump: 23.56s
Total: 78.36s
pkldb
1,000,000 records:
Insertion: 1.26s
Retrieval: 0.90s
Dump: 0.18s
Total: 2.36s
10,000,000 records:
Insertion: 14.90s
Retrieval: 10.55s
Dump: 1.71s
Total: 27.41s
20,000,000 records:
Insertion: 29.91s
Retrieval: 21.41s
Dump: 3.35s
Total: 55.15s
Key Observations
Insertion: pkldb is ~16% faster for 20M records.
Retrieval: JsonDB is slightly faster for smaller datasets, but the difference narrows for larger ones.
Dump: pkldb is consistently ~6-7x faster than JsonDB, due to orjson and atomic writes.
Overall: pkldb is ~29% faster for 20M records.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment