Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add stripPrefix to @agoric/internal, use in liveslots #9996

Open
warner opened this issue Aug 29, 2024 · 1 comment
Open

add stripPrefix to @agoric/internal, use in liveslots #9996

warner opened this issue Aug 29, 2024 · 1 comment
Labels
liveslots requires vat-upgrade to deploy changes SwingSet package: SwingSet

Comments

@warner
Copy link
Member

warner commented Aug 29, 2024

The dbKeyToEncodedKey() function in liveslots collectionManager.js is really just stripPrefix(). 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.

$ cd packages/swingset-xsnap-supervisor
$ yarn build
$ cat supervisor.bundle|jq -r .source |grep -e '\(node_modules\|packages/\)' |cut -d: -f1

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, and jessie.js.

Originally posted by @warner in #9961 (comment)

@warner warner added liveslots requires vat-upgrade to deploy changes SwingSet package: SwingSet labels Aug 29, 2024
@warner
Copy link
Member Author

warner commented Oct 9, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
liveslots requires vat-upgrade to deploy changes SwingSet package: SwingSet
Projects
None yet
Development

No branches or pull requests

1 participant