Skip to content

Initial attempt at getApproximateCount for #205#311

Draft
kriszyp wants to merge 2 commits into
mainfrom
getApproximateCount
Draft

Initial attempt at getApproximateCount for #205#311
kriszyp wants to merge 2 commits into
mainfrom
getApproximateCount

Conversation

@kriszyp

@kriszyp kriszyp commented Jan 13, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

get-sync.bench.ts

getSync() > random keys - small key size (100 records)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 24.42K ops/sec 40.96 39.45 644.874 0.118 122,077
🥈 rocksdb 2 12.13K ops/sec 82.44 79.49 4,790.993 0.191 60,652

getSync() > sequential keys - small key size (100 records)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 28.65K ops/sec 34.91 33.84 501.548 0.097 143,226
🥈 rocksdb 2 11.92K ops/sec 83.90 79.54 3,157.624 0.164 59,593

ranges.bench.ts

getRange() > small range (100 records, 50 range)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 22.94K ops/sec 43.60 36.58 2,051.417 0.287 114,676
🥈 rocksdb 2 15.91K ops/sec 62.86 55.98 1,150.337 0.122 79,541

realistic-load.bench.ts

Realistic write load with workers > write variable records with transaction log

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 492.50 ops/sec 2,030.46 95.64 38,797.359 10.14 985
🥈 lmdb 2 27.68 ops/sec 36,130.171 429.6 1,151,989.307 136.404 64.00

transaction-log.bench.ts

Transaction log > read 100 iterators while write log with 100 byte records

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 36.17K ops/sec 27.65 13.66 14,227.929 0.592 180,832
🥈 lmdb 2 434.73 ops/sec 2,300.252 201.566 12,745.922 1.35 2,174

Transaction log > read one entry from random position from log with 1000 100 byte records

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 709.45K ops/sec 1.41 1.22 4,716.79 0.197 3,547,267
🥈 lmdb 2 454.76K ops/sec 2.20 1.21 8,436.261 0.542 2,273,776

worker-put-sync.bench.ts

putSync() > random keys - small key size (100 records, 10 workers)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 847.20 ops/sec 1,180.358 1,020.831 1,995.304 0.254 1,695
🥈 lmdb 2 1.15 ops/sec 866,043.031 764,530.184 934,472.292 4.40 10.00

worker-transaction-log.bench.ts

Transaction log with workers > write log with 100 byte records

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 20.96K ops/sec 47.71 31.28 438.739 0.502 41,918
🥈 lmdb 2 817.13 ops/sec 1,223.798 272.957 11,911.933 5.58 1,636

Results from commit 9eec46b

@kriszyp
kriszyp force-pushed the getApproximateCount branch from 26d0c0d to f31ce21 Compare July 21, 2026 03:44
oxfmt requires a blank line between the bold "Key Features:" line and
the following markdown list; CI's `pnpm check` (oxfmt --check) was
failing on this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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