PlutoSliderServer.jl icon indicating copy to clipboard operation
PlutoSliderServer.jl copied to clipboard

Full bundling of precomputed slider states

Open ctrekker opened this issue 1 year ago • 1 comments

This is a draft PR for a draft PR! Precomputed sliders require many files which are often small and very similar to one another. Bundling solves both these problems in one go:

  1. Bundles can be stored in a single larger file, which can be served statically in its compressed form to reduce size
  2. Notebook clients need only request a bundle once, meaning precomputed values contained within load instantly once the bundle has been downloaded

With the following notebook we see a massive 96% compression of the staterequest folder (where the notebook updates are stored)

BEFORE BUNDLING
17M     60qMnIsupXiarVwdoPP2Vg9cewKaBJfJTlSOgeeEtW0/
AFTER BUNDLING + COMPRESSION
608K    60qMnIsupXiarVwdoPP2Vg9cewKaBJfJTlSOgeeEtW0/

Screenshot from 2023-06-14 14-10-32

There are inherent limitations to this method, so this PR will not be helpful for all notebooks. For very large slider spaces, bundling the entire space will simply be too large to load in a browser. Future changes may or may not address this issue by implementing partial bundles which only include a certain carefully chosen subset of slider values.

EDIT: Complimentary changes to the sliderserver client are in fonsp/Pluto.jl#2585

ctrekker avatar Jun 14 '23 20:06 ctrekker