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

Don't register schema by default. #479

Merged
merged 5 commits into from
Mar 3, 2023

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Mar 2, 2023

This is stacked on top of #478; review & merge that first.


This patch changes code generation so that it doesn't register schema
with the schemas package's DefaultRegistry by default. Instead, we
expose a RegisterSchemas function which must be invoked on the relevant
registry.

This is a step towards #89. The default registry still exists, and APIs
like pogs still use it implicitly, so there is more work to do.

This should make it a bit easier for the compiler to do dead-code
elimination for the schema blobs. This shaves about 28K off the tempest
WASM blob. (432K down from 460K).

We don't really need this, and it pulls in fmt.
We know the type at generation time, so there's no need for this.
This patch changes code generation so that it doesn't register schema
with the schemas package's DefaultRegistry by default. Instead, we
expose a RegisterSchemas function which must be invoked on the relevant
registry.

This is a step towards capnproto#89. The default registry still exists, and APIs
like pogs still use it implicitly, so there is more work to do.

This should make it a bit easier for the compiler to do dead-code
elimination for the schema blobs. This shaves about 28K off the tempest
WASM blob. (432K down from 460K).
@lthibault lthibault merged commit e7aafe1 into capnproto:main Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants