Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Use V8 lazy compilation/validation for TH splices #633

Merged
merged 3 commits into from
May 3, 2020

Conversation

TerrorJack
Copy link
Member

In #498, we disabled the compilation of wasm files and forced V8 to use the ignition interpreter for TH splices, since the wasm code for splices is short-lived but slow to load. However, it's possible to work around the slow loading problem without falling back to the interpreter unconditionally.

This PR enables V8's lazy compilation/validation flags when loading wasm code for splices. V8 will only validate and compile a wasm function upon first usage, and most functions shouldn't be processed since they're unused. This proves to make overall build time shorter than #498, since some wasm functions may still get hot at runtime and be optimized by JIT.

Additionally, we add the --no-validate linker option for skipping binaryen validation. We don't do binaryen validation for wasm code of splices, since V8 will validate them anyway. This is another long forgotten place which a lot of CPU cycles can be saved.

@TerrorJack TerrorJack self-assigned this May 3, 2020
@TerrorJack TerrorJack merged commit c09f88a into master May 3, 2020
@TerrorJack TerrorJack deleted the wip-th-lazy-compile branch May 3, 2020 18:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant