Skip to content

Developers can AOT compile .NET apps into WebAssembly format #44316

@marek-safar

Description

@marek-safar

As more applications target .Net in the Browser there is a growing demand to support workloads that require additional performance. The .NET5 browser-wasm runtime supports only interpreted mode and can considerably underperform in performance-sensitive code paths. Large performance gains can be realized by compiling the code ahead of time (AOT) rather than interpreting it.

Performance, size, and other considerations dictate that the AOT compilation step should run after assemblies have been aggressively trimmed. This will require that additional tooling be installed on the developer's machine when targeting AOT, including native and managed cross compilers appropriate for their host environment (emscripten SDK and mono AOT).

AOT compilation also typically generates much less compact code than the original IL. To avoid prohibitively large assets, we will likely need to offer a mode of operation where performance critical code is AOT compiled and the remaining code is interpreted.

Work Items

Metadata

Metadata

Assignees

Labels

Cost:XLWork that requires one engineer more than 4 weeksPriority:0Work that we can't release withoutUser StoryA single user-facing feature. Can be grouped under an epic.arch-wasmWebAssembly architecturearea-Meta

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions