You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run ./compare-bundles.sh on Mac/Linux, ./compare-bundles.cmd on Windows.
It will build a minified bundle, then benchmark it 50 times. Afterwards, it does a unminified bundle and runs the benchmark 50 times.
Based on my Mac M4 Pro, the minified bundle is consistently 0.248 to 0.29 ms faster than the unminified bundle, which makes logical sense.
On Windows, I'm getting mixed results. Sometimes the unminified bundle is 0.168 to 3.167 ms faster than the minified bundle. Other times the minified bundle is 0.115 to 0.903 ms faster than the unminified bundle.
On WSL, I'm also getting mixed results. Sometimes the unminified is .249 to 1.935 ms faster. Other times the minified bundle is 0.006 ms faster.
kzyp@kzyp-XPS-15-9520:~/dev/rocksdb-js$ ./compare-bundles.sh
================================
Bundle Load Performance Comparison
Iterations: 50
================================
Building minified bundle...
Minified size: 17.63 KB
Benchmarking minified bundle...
Bundle Load Performance Benchmark (Fast)
Bundle size: 17.63 KB
Measuring first-load performance (50 fresh processes)...
Progress: 50/50
=== First Load Results ===
Mean: 22.329 ms
Median: 21.929 ms
Min: 17.857 ms
Max: 33.782 ms
StdDev: 3.300 ms
P95: 29.834 ms
P99: 33.782 ms
Building unminified bundle...
Unminified size: 50.55 KB
Benchmarking unminified bundle...
Bundle Load Performance Benchmark (Fast)
Bundle size: 50.55 KB
Measuring first-load performance (50 fresh processes)...
Progress: 50/50
=== First Load Results ===
Mean: 21.959 ms
Median: 21.256 ms
Min: 16.925 ms
Max: 33.491 ms
StdDev: 3.550 ms
P95: 29.244 ms
P99: 33.491 ms
================================
COMPARISON
================================
Size difference: 32.92 KB (186.7% larger)
✗ Unminified is faster by .673 ms (3.1% improvement)
This suggests V8 parse/compile time dominates over network transfer.
Results saved in /tmp/minified-results.txt and /tmp/unminified-results.txt
Restored minified bundle to dist/index.mjs
kzyp@kzyp-XPS-15-9520:~/dev/rocksdb-js$ ./compare-bundles.sh
================================
Bundle Load Performance Comparison
Iterations: 50
================================
Building minified bundle...
Minified size: 17.63 KB
Benchmarking minified bundle...
Bundle Load Performance Benchmark (Fast)
Bundle size: 17.63 KB
Measuring first-load performance (50 fresh processes)...
Progress: 50/50
=== First Load Results ===
Mean: 19.743 ms
Median: 19.949 ms
Min: 16.425 ms
Max: 30.270 ms
StdDev: 2.666 ms
P95: 24.905 ms
P99: 30.270 ms
Building unminified bundle...
Unminified size: 50.55 KB
Benchmarking unminified bundle...
Bundle Load Performance Benchmark (Fast)
Bundle size: 50.55 KB
Measuring first-load performance (50 fresh processes)...
Progress: 50/50
=== First Load Results ===
Mean: 19.108 ms
Median: 18.215 ms
Min: 16.428 ms
Max: 33.168 ms
StdDev: 2.803 ms
P95: 23.030 ms
P99: 33.168 ms
================================
COMPARISON
================================
Size difference: 32.92 KB (186.7% larger)
✗ Unminified is faster by 1.734 ms (9.5% improvement)
This suggests V8 parse/compile time dominates over network transfer.
Results saved in /tmp/minified-results.txt and /tmp/unminified-results.txt
Restored minified bundle to dist/index.mjs
Unminified was actually faster on my machine.
Anyway, this certainly is not urgent or that important. Just thought the difference might be small enough that it might be preferable to keep the more readable builds, but I certainly know how to use unminified for my own local development.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run
./compare-bundles.shon Mac/Linux,./compare-bundles.cmdon Windows.It will build a minified bundle, then benchmark it 50 times. Afterwards, it does a unminified bundle and runs the benchmark 50 times.
Based on my Mac M4 Pro, the minified bundle is consistently 0.248 to 0.29 ms faster than the unminified bundle, which makes logical sense.
On Windows, I'm getting mixed results. Sometimes the unminified bundle is 0.168 to 3.167 ms faster than the minified bundle. Other times the minified bundle is 0.115 to 0.903 ms faster than the unminified bundle.
On WSL, I'm also getting mixed results. Sometimes the unminified is .249 to 1.935 ms faster. Other times the minified bundle is 0.006 ms faster.
Note: This PR is not meant to be merged.