-
Notifications
You must be signed in to change notification settings - Fork 31
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
build-wasm: generated .wasm file excessively large and very slow #1
Comments
After generating with the latest I can't reproduce the performance issue using the |
Compiling this parser to wasm (and to native) does take longer than compiling some of the other parsers - it's because the lexing function is more complex due to all of the unicode operators that Julia allows. |
I'm currently running it with node.js (tests), not in the browser. I'm seeing that in web-ui it works fine - I assumed that if in node was slow then in the browser too, but didn't test it in browser. I will keep investigating and close this or update it. if is a problem only in node then is not big deal, and I'm not worried if it takes longer to compile the wasm . Also output size is acceptable, the current problem right now, in node.js is taht it takes 50s to load the wasm. The tests in node.js do something like the following, and the bottleneck is not in parse() but in Parser.Language.load()
Thanks, again, i'm investigating and if it only happens in node.js will close this. |
I think it has to do with emscripten-core/emscripten#6633 (comment) Changing https://github.com/tree-sitter/tree-sitter/blob/177ba49e57abaf2bfe247ea3becdb2e3a425de86/lib/binding_web/binding.js#L591 to (async false): .then(bytes => Promise.resolve( loadWebAssemblyModule(bytes, {loadAsync: false})) ) makes
|
The parser has gotten smaller and compiles more quickly now recently. The WASM module works well for me in the web UI, so I'm going to close this out. |
Similar to tree-sitter/tree-sitter-ocaml#30
build-wasm will generate a 7MB .wasm file.
Updating dependencies of this project improves to 3MB file but still very big compare to the others.
But the real problem is that running it with node.js is very slow, It takes 50s to parse a trivial statement like
x = 10
.I tried to run tree-sitter build-wasm both using docker and local emcc with the same results.
I tried to digg in and I can't see any differences between other projects like tree-sitter-rust, bash, etc.
Basically the project is not usable while executing wasm. :(
The text was updated successfully, but these errors were encountered: