Conceptual
Login

The JS-Wasm Boundary Crossing Cost

Every call between JavaScript and Wasm pays for argument type conversion, trampoline entry, and lost inlining across the boundary; engines have cut it to tens of nanoseconds but it still dwarfs an inlined call. The optimization rule is to make few, coarse-grained calls that do lots of work per crossing rather than chatty fine-grained ones.

This Concept is waiting for its first lesson!

Every call between JavaScript and Wasm pays for argument type conversion, trampoline entry, and lost inlining across the boundary; engines have cut it to tens of nanoseconds but it still dwarfs an inlined call. The optimization rule is to make few, coarse-grained calls that do lots of work per crossing rather than chatty fine-grained ones.

Are you a teacher? Sign in to start contributing.

Sign In