3 ms·
Seems like AOT compilation is spotty on Asp.NET apps. A fresh app made with dotnet new webapi -o aot-api did not work when run.
by Capricorn2481 3y ago
Seems like AOT compilation is spotty on Asp.NET apps. A fresh app made with dotnet new webapi -o aot-api did not work when run.
- baz00 3y agoKilling that startup JIT is important if you want to scale out fast.
- mdasen 3y agoI haven't completely followed the AOT stuff, but I remember hearing some stuff about some reflection-heavy code doesn't play well with AOT. But .NET has a great option in this case: ReadyToRun. Basically, it AOT compiles a ton of stuff, but also creates the byte code which can be JIT optimized at runtime. The file output is larger which is a downside, but is usually a very minute downside. ReadyToRun takes care of start up times because you have the machine code to get things running fast. Plus, the JIT can sometimes make optimizations that can't be done at compile time so you can end up with better overall performance (at the cost of a larger executable file). One of the things that is nice about .NET is that a lot of things come with sustained, multi-year effort with some good things coming every year. Microsoft is working on making more and more of .NET AOT-friendly and really upgrading the way things are done. Along the way, there are things like ReadyToRun which work really well for what most people want/need.
- neonsunset 3y agoGive 'dotnet new webapiaot' a try (you can see more details with 'dotnet new list' or 'dotnet new {template} -h' to see extra options for a specific template).
- pjmlp 3y agoASP.NET with AOT is only supported in minimal APIs, nothing else.