Skip to content

Conversation

@kriszyp
Copy link
Member

@kriszyp kriszyp commented Jan 2, 2026

I think we originally thought minification would improve load speed. It turns out that it does not. I measured load time with and without minification, and it is consistently 12-13ms regardless of minification. Any impact of minification is less than statistical noise, less than a millisecond, and negligible. Avoiding minification makes it much easier to debug, and doesn't seem to incur any performance regresssion.
I did still include a script for doing minification, but it isn't used by default.

@kriszyp kriszyp marked this pull request as ready for review January 2, 2026 16:48
@cb1kenobi cb1kenobi changed the base branch from reenable-unit-tests to main January 7, 2026 23:36
@kriszyp kriszyp force-pushed the turn-off-minification branch from da71d99 to 0b83b16 Compare January 7, 2026 23:39
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

📊 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 21.13K ops/sec 47.32 41.31 638.246 1.05 10,566
🥈 rocksdb 2 4.19K ops/sec 238.481 204.759 24,568.449 9.65 2,097

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

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 26.82K ops/sec 37.28 35.72 573.083 0.466 13,411
🥈 rocksdb 2 4.81K ops/sec 208.008 197.009 671.645 0.240 2,404

ranges.bench.ts

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

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 23.11K ops/sec 43.28 37.37 438.681 0.979 11,554
🥈 rocksdb 2 3.35K ops/sec 298.473 269.414 834.196 1.24 1,676

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 182.40 ops/sec 5,482.514 57.38 161,718.011 46.53 384
🥈 lmdb 2 25.99 ops/sec 38,478.833 177.963 1,206,803.237 136.935 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 31.90K ops/sec 31.35 16.53 497.499 0.725 15,949
🥈 lmdb 2 420.63 ops/sec 2,377.395 833.397 9,528.478 4.66 211

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 566.79K ops/sec 1.76 1.52 463.829 0.400 283,395
🥈 lmdb 2 282.51K ops/sec 3.54 1.76 5,277.528 4.72 141,257

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 844.93 ops/sec 1,183.532 1,016.048 1,925.136 0.381 1,690
🥈 lmdb 2 0.97 ops/sec 1,028,359.044 853,482.032 1,094,403.008 5.02 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 17.83K ops/sec 56.09 30.36 5,929.896 0.829 35,659
🥈 lmdb 2 791.86 ops/sec 1,262.85 176.53 16,312.693 5.71 1,584

Results from commit 7a2068f

@cb1kenobi
Copy link
Contributor

I wrote a benchmark (#304) that tests minified vs unminified and the minified bundle consistently is 0.29 ms to 0.248 ms faster on my Mac.

How did you benchmark this?

@kriszyp
Copy link
Member Author

kriszyp commented Jan 8, 2026

How did you benchmark this?

let start = performance.now(); require('.'); console.log(performance.now() - start);

Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

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

No worries, let's merge it!

@cb1kenobi cb1kenobi merged commit e8aa86e into main Jan 8, 2026
20 checks passed
@kriszyp
Copy link
Member Author

kriszyp commented Jan 8, 2026

oh, ok, I was just going to close it, I thought you didn't want this, but sure, cool!

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.

3 participants