Skip to content

[FEATURE REQUEST] Optimize exceptions #117

@vouillon

Description

@vouillon

Exceptions are slow in Wasm since the stack is unwound in a generic way.

One could experiment with changing the calling convention to return null on exception (storing the exception in a global value). That should not be too much work since it only involves the generated code (and the runtime code to invoke callbacks). The runtime would still throw Wasm exceptions.

Another approach would be to change the calling convention only for functions that may throw an exception and which we know are called from within an exception handler. If the optimized function may escape, we can call it from a wrapper function that will raise a Wasm exception. This will cover many cases like searching in a list or a map while keeping a faster calling convention in most cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions