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

Extreme WASM size #5

Closed
char0n opened this issue Sep 23, 2020 · 4 comments
Closed

Extreme WASM size #5

char0n opened this issue Sep 23, 2020 · 4 comments
Labels
question Further information is requested

Comments

@char0n
Copy link

char0n commented Sep 23, 2020

Hi @ikatyang,

First of all thank you for this YAML grammar for tree-sitter. I wanted to ask about the size of src/parser.c size. It seems a little bit extreme at 940K. After the parser grammar is compiled to WASM size is 719,3 KiB (736 604 bytes).

Are you aware of this? Can we do something about it?

Thanks!

@ikatyang
Copy link
Owner

Hi, I recompiled tree-sitter-yaml.wasm with [email protected], it is now 135KB (b26d567).

@ikatyang ikatyang added the question Further information is requested label Sep 23, 2020
@char0n
Copy link
Author

char0n commented Sep 23, 2020

Steps To Reproduce

$ cd /tmp
$ npm i [email protected]
$ npm i npm i [email protected]
$ ./node_modules/.bin/tree-sitter build-wasm ./node_modules/tree-sitter-yaml/
$ du -h tree-sitter-yaml.wasm

720K tree-sitter-yaml.wasm

I'm on Ubuntu Linux based system. Here is basically a POC repo that is prebuilding all the WAMS(s) for tree-sitter and is getting the same size of YAML WASM.

@ikatyang
Copy link
Owner

The parser.c shipped with npm:[email protected] is generated by [email protected], you probably need to tree-sitter generate before tree-sitter build-wasm to get the 135KB wasm.

@char0n
Copy link
Author

char0n commented Sep 23, 2020

@ikatyang right, that decreased the size to expected 135KB WASM. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants