Skip to content

fix: C macro memory issue #455

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

Merged
merged 1 commit into from
May 12, 2020

Conversation

MartinKavik
Copy link
Member

When the app in quickstart-webpack uses Seed 0.7.0 and C! (instead of class!), then the WASM file size (in debug mode) has 7.58 MB and fails during the start with CompileError: wasm validation error: at offset 26669: too many locals (build is also pretty slow).

Both new helper functions introduced in the PR - _fill_all_classes and _all_classes_to_attrs - reduce the WASM size by +/-2 MB so with this PR the result size is 3.15 MB.

I've resolved this issue by intuition, but I don't really know why this happens, how to prevent it and if we can define a general rule - e.g. "macros should be as small as possible".

Opinions? (cc @rebo, @akhilman, @flosse, @TatriX)

@MartinKavik MartinKavik merged commit b25cf59 into seed-rs:master May 12, 2020
@akhilman
Copy link
Member

akhilman commented May 12, 2020 via email

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