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

Use cljs analyzer API to not pull all metadata to run time #767

Closed
borkdude opened this issue Jun 19, 2022 · 1 comment
Closed

Use cljs analyzer API to not pull all metadata to run time #767

borkdude opened this issue Jun 19, 2022 · 1 comment
Assignees

Comments

@borkdude
Copy link
Collaborator

borkdude commented Jun 19, 2022

When writing (meta (var x)) in CLJS, you basically pull all metadata to the runtime. Instead you can do:

(ana/resolve {} 'memfn)

at compile time, then inspect some metadata and only copy what is needed to the runtime.

We can leverage this better in sci.impl.namespaces and sci.core.

@borkdude
Copy link
Collaborator Author

In branch resolve-better this saves about 100kb: 900kb -> 800kb. More space can be saved by moving more stuff to compile time in the expanded code and maybe moving some cond-> stuff into a function.

@borkdude borkdude self-assigned this Jun 22, 2022
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

No branches or pull requests

1 participant