You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[emval] Reduce C++ -> JS calls in emscripten::val lifetime management (#21366)
Related to #21300, but some obviously good incremental wins to reduce the cost of ref counting:
1. Have C++ consistently avoid inc/dec for the special reserved values that don't need to be counted, this saves decref calls every time such a `val` object goes out of scope.
2. Add an rvalue reference version of toWireType for `emscripten::val` that can transfer ownership to JS. This saves one call to incref and one call to decref for the case of a c++ function with return type `emscripten::val`
The cost seems to be single-digit bytes to the WASM.
0 commit comments