0

In a Blazor WebAssembly project with AOT, is there a way to detect at runtime whether a function body is interpreted or runs natively as WASM instructions?

Background. I tried AOT in my Blazor WebAssembly project. I see that dotnet.wasm.xxx file got much bigger and the general performance has improved. However I have doubts about my code that is loaded and called dynamically. I suspect AOT compiler may not be able to discover that code at build time, and therefore it has to be interpreted at run time. Looking for a way to instrument that code to print at run time if it's being interpreted or runs natively.

SergeyS
  • 3,909
  • 2
  • 15
  • 17
  • Does this answer your question? [How to check the code is running in AOT in C#?](https://stackoverflow.com/questions/66635700/how-to-check-the-code-is-running-in-aot-in-c) – Mister Magoo Dec 26 '22 at 10:32
  • The accepted answer to similar https://stackoverflow.com/questions/66635700/how-to-check-the-code-is-running-in-aot-in-c suggests to check the properties of RuntimeFeature class. It does not help to detect AOT for a function frame in WASM. It always returns IsDynamicCodeSupported=True IsDynamicCodeCompiled=False, which makes sense - in WASM the dynamic code is always supported and is always interpreted thanks to the fallback to the interpreting mode in AOT. – SergeyS Dec 26 '22 at 12:40

0 Answers0