Skip to content

Sort the local variable order with the most frequently referenced first. #18

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

Closed
ghost opened this issue Dec 21, 2015 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Dec 21, 2015

To give a canonical ordering for experimenting with the encoding efficiency it might help to sort each functions local variables with the most frequently referenced first. This way an encoding optimizing for small local variable indexes might do best, such as the polyfill-prototype-1. I assume similar encoding optimizations will be used in the MVP too because it appears quite effective.

@kripken
Copy link
Member

kripken commented Dec 21, 2015

We can do this in a binaryen pass, then it wouldn't be tied to asm2wasm (but asm2wasm could run it in its optimizations phase).

@kripken kripken changed the title asm2wasm: sort the local variable order with the most frequently referenced first. Sort the local variable order with the most frequently referenced first. Dec 21, 2015
@tlively
Copy link
Member

tlively commented Dec 13, 2024

This is done by the ReorderLocals pass.

@tlively tlively closed this as completed Dec 13, 2024
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

2 participants