78 ms·
> I wonder how things like ASP .NET will run with Native AOT in the future. Let me give an example of an ASP.NET app lifecycle: an instance is launched, goes t
by SideburnsOfDoom 4y ago
> I wonder how things like ASP .NET will run with Native AOT in the future.
Let me give an example of an ASP.NET app lifecycle: an instance is launched, goes through startup code once. When it reports itself healthy, it is put into the Load balancer and then starts handling requests. Code in these paths is executed anywhere from occasionally to 1000s of times per second. After around 24 hours of this, it is shut down and restarted automatically.
So, compiler micro-optimising startup code to take ms off of it, is not interesting at all - it's only run once a day. Startup can take whole seconds, it makes little difference, the instance is ready when it's done. AOT in general isn't that important, but automatic tiered compilation based on usage data is very nice.
- ewjt 4y agoServerless. Running an ASP.NET app in AWS Lambda is just a few lines of code. However, all of a sudden startup time becomes important for both performance and cost. These investments by Microsoft and others[1] allow .NET to remain relevant and viable for modern use cases. [1] https://github.com/awslabs/dotnet-nativeaot-labs https://github.com/awslabs/dotnet-nativeaot-labs
- SideburnsOfDoom 4y agoServerless is great, but if you want to go that route you should be aware that it is in no way a typical hosted ASP.NET app, and while you can "Run an ASP.NET app in AWS Lambda" with little code, there are are better ways to design a Lambda.
- ewjt 4y agoCan you elaborate on “is in no way a typical hosted ASP.NET app”? I get that the machinery under the hood is different (ie. Kestrel web server may not get used). However, we typically don’t care about those details. Our ASP.NET code runs in 3 separate places (containers, servers, Lambda) and the only difference between all 3 is a single entry point file. Do you mean because Lambda is only serving one request at a time and has a more ephemeral host process lifetime?
- SideburnsOfDoom 4y ago> Lambda is only serving one request at a time and has a more ephemeral host process lifetime Yes, a typical hosted ASP.NET app is neither ephemeral or one request at a time. So this drives different design decisions.
- trevorishere 4y agoSharePoint, as an example, can take 1+ minutes to JIT.