News for hackers. Stuff that matters.
Re:Performance Improvements in .NET 7 by fabian2k on Wednesday August 31, 2022 @10:34AM (#32662534)
The "typical" in my comment was meant to take care of that part, I probably should have mentioned this explicitly. AWS Lambda is of course a case where startup time matters a lot, but it still leaves the common problem of ASP.NET that it was designed around a lot of reflection. My understanding is that this simply won't work with AOT out of the box unless you adapt all the places where you use reflection-based code. For example you'd need to use the source generator versions of JSON serialization and the EF Core DbContext in this case, with all limitations those have. But I'm not sure my understanding here is entirely correct or complete.
Re:Performance Improvements in .NET 7 by tmitchel2 on Wednesday August 31, 2022 @10:47AM (#32662729)
I think you are correct. The DI container and JSON serialisation are two bigger areas that i suspect would need attention but as you say source generation solves the later and I think there is non reflection DI on the way if not already. I guess you would need to wait for any of the third party assemblies you depend on to allow for no reflection also...still a bit of a wait i think for my use case.
Re:Performance Improvements in .NET 7 by paavohtl on Wednesday August 31, 2022 @10:38AM (#32662591)
I don't know about ASP.NET, but the post says that Reflection.Emit is not available. Reflection.Emit is a namespace used for runtime code generation; I would assume most other parts of reflection are available, like with previous iterations of AOT support in .NET.
Re:Performance Improvements in .NET 7 by kevingadd on Wednesday August 31, 2022 @01:04PM (#32665157)
It is theoretically possible to have Reflection.Emit and DynamicMethod for less critical cases by using an interpreter - this happens in certain scenarios already.