Skip to content

Instantly share code, notes, and snippets.

@wjordan
Created June 5, 2017 18:52
Show Gist options
  • Save wjordan/91f577f5af06c5e05a9c083dc3ccd5a3 to your computer and use it in GitHub Desktop.
Save wjordan/91f577f5af06c5e05a9c083dc3ccd5a3 to your computer and use it in GitHub Desktop.
bootsnap benchmark

extract_cache branch:

~/Code/discourse$ for i in {1..5}; do (rm -rf tmp/cache && time bundle exec rails r 'puts "Save cache"' && time bundle exec rails r 'puts "Load Cache"'; du -hs tmp/cache/bootsnap-compile-cache); done
Save cache

real	0m3.007s
user	0m2.768s
sys	0m0.196s
Load Cache

real	0m1.709s
user	0m1.564s
sys	0m0.112s
13M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m2.840s
user	0m2.576s
sys	0m0.232s
Load Cache

real	0m1.722s
user	0m1.536s
sys	0m0.152s
13M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m2.870s
user	0m2.652s
sys	0m0.184s
Load Cache

real	0m1.704s
user	0m1.556s
sys	0m0.116s
13M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m2.849s
user	0m2.640s
sys	0m0.176s
Load Cache

real	0m1.707s
user	0m1.556s
sys	0m0.120s
13M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m2.899s
user	0m2.644s
sys	0m0.220s
Load Cache

real	0m1.700s
user	0m1.540s
sys	0m0.128s
13M	tmp/cache/bootsnap-compile-cache

baseline:

~/Code/discourse$ for i in {1..5}; do (rm -rf tmp/cache && time bundle exec rails r 'puts "Save cache"' && time bundle exec rails r 'puts "Load Cache"'; du -hs tmp/cache/bootsnap-compile-cache); done
Save cache

real	0m3.879s
user	0m2.484s
sys	0m1.364s
Load Cache

real	0m1.698s
user	0m1.540s
sys	0m0.124s
45M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m2.854s
user	0m2.516s
sys	0m0.308s
Load Cache

real	0m1.837s
user	0m1.644s
sys	0m0.152s
45M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m3.158s
user	0m2.664s
sys	0m0.460s
Load Cache

real	0m1.682s
user	0m1.528s
sys	0m0.120s
45M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m3.197s
user	0m2.492s
sys	0m0.676s
Load Cache

real	0m1.699s
user	0m1.520s
sys	0m0.144s
45M	tmp/cache/bootsnap-compile-cache
Save cache

real	0m3.482s
user	0m2.464s
sys	0m0.988s
Load Cache

real	0m1.667s
user	0m1.524s
sys	0m0.108s
45M	tmp/cache/bootsnap-compile-cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment