ComponentizeJS icon indicating copy to clipboard operation
ComponentizeJS copied to clipboard

Dynamic Linking of SpiderMonkey Interpreter

Open royaljain opened this issue 2 years ago • 3 comments

Problem

The size of wasm module produced is quite high, ~ 8 MB for a function adding two numbers. My understanding is that the interpreter (SpiderMonkey) is the majority of it.

Query

Is there a way to dynamically link the interpreter and wasm module to reduce the module size? The primary benefit is when there are multiple wasm modules & instances

For reference: Javy has -d flag for enabling dynamic linking

royaljain avatar Oct 26 '23 12:10 royaljain

Yes this remains a goal for this project, where the engine itself can be imported as a core module that can be dynamically linked.

This work is not currently being prioritised for a while yet, unless someone wants to pick it up.

guybedford avatar Oct 26 '23 16:10 guybedford

Got it.

Is this connected to the component model, will the linking be done through that?

royaljain avatar Oct 27 '23 04:10 royaljain

I just ran into this as well. I'm seeing componentize() produce a 10MB binary when I give it a module with nothing but empty stub functions for my world.

maxbrunsfeld avatar Nov 22 '24 23:11 maxbrunsfeld