Skip to content

host-gen-js: Output optimization#416

Closed
guybedford wants to merge 7 commits intobytecodealliance:mainfrom
guybedford:opt
Closed

host-gen-js: Output optimization#416
guybedford wants to merge 7 commits intobytecodealliance:mainfrom
guybedford:opt

Conversation

@guybedford
Copy link
Copy Markdown
Contributor

This is based to #415, which is in turn based to #414, so should land after those.

Updates the output to be more friendly to minifiers resulting in a smaller total JS file size - arrow functions are used for intrinsics, and the dataView(memory) pattern is replaced with a dedicated dataView{n} binding per memory, which should be able to be optimized out if not used for a particular memory.

@alexcrichton
Copy link
Copy Markdown
Member

This looks reasonable, but the dataView optimization I don't think will work because memory.grow can invalidate the prior ArrayBuffer so JS needs to always check to see if the ArrayBuffers match to get the most up-to-date view of memory.

@guybedford
Copy link
Copy Markdown
Contributor Author

Ah, ok I can't come up with a better alternative, will close this then.

@guybedford guybedford closed this Nov 8, 2022
@guybedford guybedford deleted the opt branch November 8, 2022 00:26
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

Successfully merging this pull request may close these issues.

2 participants