Open warner opened 2 months ago
@gibson042 points out that it would be great to have CI measure the size of bundles and the reach of their dependency graph, so we could learn if/when new dependencies cause bundles to grow. Like a job that says "bundle size has grown by more than N bytes", or "bundle is now larger than N bytes", kind of like how code-coverage metric changes are reported.
We may get some better tree-shaking/etc behavior out of our Endo bundler, which may help. Currently we think it's module-at-a-time, but "barrel" modules (like a single index.js which re-exports everything of a package) tend to pull in a lot of things that aren't actually used by their clients. But we've agreed to support deep imports for @agoric/internal
to reduce this problem.
The
dbKeyToEncodedKey()
function in liveslotscollectionManager.js
is really juststripPrefix()
. That seems like a useful function to add to@agoric/internal
, and then use from liveslots.My one concern is whether it would grow the xsnap-supervisor bundle significantly (i.e. what else will get dragged in when we add
@agoric/internal
). Here's a recipe to find out what went into the supervisor bundle, so we can compare if/when we do that.That will emit a list of the packages included in the supervisor bundle (which is how liveslots gets delivered to a worker). That currently (once PR #9961 lands) includes:
packages/store
packages/swingset-liveslots
packages/swingset-xsnap-supervisor
@endo/{base64,common,compartment-mapper,env-options,errors,eventual-send,exo,far,import-bundle,marshal,nat,pass-style,patterns,promise-kit,zip}
At a quick glance, adding
@agoric/internal
might grow that with@endo/{init,stream}
,@agoric/base-zone
,anylogger
, andjessie.js
._Originally posted by @warner in https://github.com/Agoric/agoric-sdk/pull/9961#discussion_r1736956308_