Skip to content

Fix TransactionOptions type and enable retryOnBusy to saveStructures#533

Merged
cb1kenobi merged 2 commits into
mainfrom
transaction-fixes
Apr 29, 2026
Merged

Fix TransactionOptions type and enable retryOnBusy to saveStructures#533
cb1kenobi merged 2 commits into
mainfrom
transaction-fixes

Conversation

@cb1kenobi
Copy link
Copy Markdown
Member

Found a few inconsistencies with the TransactionOptions type.

Also, with #531 being closed, I thought it was a good idea to add the retryOnBusy flag to the saveStructures callback.

@cb1kenobi cb1kenobi requested a review from a team as a code owner April 29, 2026 03:06
@github-actions
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 23.67K ops/sec 42.25 40.74 591.549 0.118 118,348
🥈 rocksdb 2 12.01K ops/sec 83.28 80.69 22,446.148 0.889 60,040

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

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 27.21K ops/sec 36.76 35.73 680.957 0.105 136,028
🥈 rocksdb 2 12.68K ops/sec 78.87 76.97 2,956.385 0.125 63,393

ranges.bench.ts

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

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 24.73K ops/sec 40.44 38.68 909.816 0.135 123,655
🥈 rocksdb 2 3.56K ops/sec 281.065 247.49 3,825.719 0.545 17,790

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 188.64 ops/sec 5,301.082 57.42 135,118.72 34.20 384
🥈 lmdb 2 26.36 ops/sec 37,937.679 432.933 1,198,101.046 136.45 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 33.39K ops/sec 29.95 13.20 14,247.811 0.603 166,929
🥈 lmdb 2 441.73 ops/sec 2,263.809 142.141 13,281.873 1.32 2,209

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 726.22K ops/sec 1.38 1.20 4,150.421 0.184 3,631,084
🥈 lmdb 2 435.18K ops/sec 2.30 1.21 8,894.853 0.630 2,175,892

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 838.60 ops/sec 1,192.459 1,010.986 1,814.431 0.428 1,678
🥈 lmdb 2 1.16 ops/sec 859,409.996 818,924.401 904,604.54 2.18 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 18.16K ops/sec 55.08 29.08 523.474 0.527 36,312
🥈 lmdb 2 827.79 ops/sec 1,208.033 162.955 14,637.209 5.31 1,656

Results from commit 934bf44

Copy link
Copy Markdown
Member

@kriszyp kriszyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, that was indeed the important part of my old PR that should be saved, thank you!

@cb1kenobi cb1kenobi merged commit 8999431 into main Apr 29, 2026
20 checks passed
@cb1kenobi cb1kenobi deleted the transaction-fixes branch April 29, 2026 14:22
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.

2 participants