-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Minor optimizer simplification opportunity #4367
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
Comments
Yes, the However, there is still some chance we'll want that functionality, and it's probably not a big difference in overhead, so I think it's not worth doing. If you are looking for optimizer optimization opportunities, I suggest focusing on the binaryen optimizer. It should be much faster than the asm.js optimizer since it has a much nicer IR to operate on - in particular, it doesn't have any quirks like this uglify issue here. If we can get it fast enough, and we can write an efficient wasm2asm pass, then we could deprecate the asm.js optimizer, in fact - although both of those ifs are still open questions. Right now I am still adding optimizations to it, but there is already a lot of data-structure type optimization that could be done ( |
Cool, thanks for the confirmation. I stumbled across it mainly because I'm reimplementing the emscripten optimizer in rust. Parsing code porting is complete and the in-memory representation seems to be 1/3 of the size. After that's done, I'll probably also implement the binaryen optimizer in rust and keep track pace with the changes you make. |
Oh, very interesting about the rust reimplementations! Is there a repo I can follow? |
https://github.com/aidanhs/ayzim - the general code organisation should be pretty familiar ;) You won't be able to build it without servo/string-cache#136 and it only parses JS/JSON+emits JSON so far, but in terms of LOC % it's probably about halfway there. |
Cool, thanks. |
kripken/cashew@f729e38#diff-3
The 'true' appears to be inherited from the uglifyjs 1 parser where it could be replaced by one of
['+', '-', '/', '*', ...]
to represent the corresponding assignment operators. I don't see any of these complex operators in the asm.js spec - http://asmjs.org/spec/latest/Two questions:
The text was updated successfully, but these errors were encountered: