You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Performance has been a key .NET feature. The existing options for optimizing published applications work well for most scenarios that .NET targets today.
Some of you asked us to consider adding native AOT compilation option with distinctly different characteristics. The distinctly different characteristics of native AOT come with tradeoffs such as lower compatibility that are explained in detail in .NET Runtime Form Factors. We’ve created a survey to help us better understand the native AOT use cases.
We would appreciate your feedback so we can work on creating the right plans for future. If you don’t supply contact details, then responses will be anonymous.
Reacted by Damian Edwards, Clinton Ingram, Reilly Wood, Ben {chmark} Adams, Muhammad Azeez, Dan Moseley, Kevin Rio, John Tur, Joseph Musser, Saravana J and 142 more
Reacted by Dan Moseley, David Fowler, Stanislav Denisov, Wiesław Šoltés, Nerevar Indoril, Eduardo Larios, pi, Yuyi Wang, Vijay Britto, Fabian Terhorst and 23 more
Reacted by Ganbarukamo41, Breece Walker, Sergio Pedri, Dan Moseley, John Tur, Nobuyuki Iwanaga, Ryouko Konpaku, Adam Caviness, Stanislav Denisov, Wiesław Šoltés and 39 more
Reacted by Ganbarukamo41, Sergio Pedri, Jeremy Koritzinsky, David Maas, Dan Moseley, Ryouko Konpaku, Stanislav Denisov, Wiesław Šoltés, Nerevar Indoril, czimnick and 27 more
Looks like a typo - * 9. Which of these tasks are apart of your production debugging workflow? (Please select all that apply) Maybe it should be "a part of"?
Question: for UWP devs that have worked with the .NET Native toolchain, should we answer the survey just saying we haven't used CoreRT before, or since .NET Native has many similarities (and some shared code too?) with CoreRT, should we just mention this in the notes and then reply the other CoreRT questions just with respect to our experience with .NET Native? 🤔
Reacted by Eduardo Larios, Breece Walker and John Kelly
Reacted by Reilly Wood, Eduardo Larios and John Kelly
@Sergio0694 thanks for the UWP question. I agree, I think it makes sense to mention that in the notes and reply to the use corert if you had used the open source version.
I was also confused about how to answer certain questions as a UWP dev who has only used .NET Native. I have a number of opinions about UWP’s .NET Native toolchain but I didn’t really see a place to write them down. Totally fine if that’s outside the scope of this survey but it might be worth clarifying.
I also suspect “because .NET Native is the default for UWP release builds and required in the Store” is probably the most common reason why people use AOT but it’s not one of the pre-populated answers for question 5.
Thanks for including Avalonia in the GUI options :) We've experimented with CoreRT+Avalonia before and the results were gorgeous native GUI apps :D though we havent maintained compat since it's been 2 yrs then...
Reacted by Wojciech Nagórski, CryShana, Jeremy Sinclair and JamesLear92
Reacted by Eduardo Larios, Jeremy Koritzinsky, Arkadiusz Wójcik, Johannes Buchholz, Vladimir Akopyan, Shivendra Pratap Singh, SingleAccretion, John Kelly, Joseph Moreno and Hubert Rybak
An often forgotten part of .net is game development, a lot of platforms do not allow a JIT to run, think of Consoles or IOS devices.
It is very important for the future of game development to get .net native AOT as a first-class citizen of the .net ecosystem.
Some game engines rolled their own AOT (for example Unity does with il2cpp) but it is an absolute trainwreck.
So an official solution would be more than welcome. It could be a industry changing event.
Don't forget that the game industry is overtaking the filming industry in both profit and turnover.
Consoles is where the main profit is being made.
Reacted by Stanislav Denisov, Prajay Basu, Reilly Wood, Eduardo Larios, Franco Pereira, Tomáš Hübelbauer, Lukasz "iniside" Baran, Atrufulgium, Peter Bertok, Luxko and 36 more
I have wished that I could easily AOT compile my code while trying out all of the above scenarios in C# over the last few years and I feel that .NET is missing out heavily compared to LLVM based languages like Rust.
The reason why the current publishing options appear to "work well' is because .NET has historically not been suitable for the above scenarios and people just implement their own AOT (e.g.: Unity, UWP, Mono) when using C#. Partial AOT solutions such as native image (e.g., ReadyToRun) might "help" in cold start scenarios for monolithic server applications or large desktop client applications but the binary size is still many times larger than what a full AOT runtime would produce.
The real issue is that there's currently too many runtimes/code generators/toolchains/experiments available with their own quirks: IL2CPP/Burst (Unity), Mono's AOT backend (Xamarin/Blazor/Uno), .NET Native/CoreRT (UWP), Mono's LLVM backend, CrossGen/ReadyToRun (.NET Core), etc. and it's simply unacceptable that .NET does not have a standardized AOT compilation toolchain.
If all these teams combined their engineering effort on something common such as CoreRT, Mono LLVM backend or the now-abandoned dotnet/lilic then AOT would have been a much better experience for .NET devs.
AOT w/ static linking is accessible to a large number of developers now with CI/CD for the masses and it is not just an annoyance for a marginal increase in performance anymore.
C# endgame: Native code, native UI, fast and easy interop, native exports and performance oriented APIs (e.g., System.IO.Pipelines, System.Text.Json).
Reacted by Maxim, Stanislav Denisov, wanton7, Johan Mulder, Eduardo Larios, Kurai András, gedo4547, Jason Meisel, Huo Yaoyuan, Hubert Rybak and 65 more
Reacted by codemkey
Reacted by Wojciech Nagórski, gedo4547, Greg Domzalski, Ashleigh Adams and codemkey
I disagree with the statement saying webapps wouldn't benefit from this. AOT would help greatly with serverless workloads (aka Azure Functions). Not to mention the benefits from startup time for CLI tools.
Reacted by wanton7, Mukul Sabharwal, Eduardo Larios, gedo4547, Tomáš Hübelbauer, Hubert Rybak, Grendler, Nathan Alden, Sr., T. Thiery, Angius and 15 more
I have answered the survey, but to be honest I don't get this continuous asking of surveys since .NET Core 1.0 started, without a clear direction where things are going.
.NET Native is what .NET should have been all along, back when Ext-VOS project started, and there is the experience from Singularity and Midori that you guys can certainly relate to, or even get some internal servers with them going on.
Even Java has decided to catch up with its missing AOT capabilities the team isn't asking what workloads we want to have it working.
We hardly use NGEN, because since .NET release its code quality generation was never improved and the deployment workflow is a pain versus other AOT compiled languages.
So if going forward, AOT is dropped again from .NET consider that all the competition in managed languages is now focusing in AOT toolchains, and they also don't ask which workflows we would like to use the compiler.
I want to see .NET continuing to flourish and being the first option regardless of the scenario, and if anything to take over workflows where Microsoft still forces us to use C++ alongside .NET, which other AOT compiled languages don't have issues with.
Reacted by Eduardo Larios, Peter Bertok, Luxko, Shivendra Pratap Singh, Nathan Alden, Sr., T. Thiery, Angius, Robert Campbell, commonalitydev, Jay Gowdy and 12 more
Security is not all or nothing. Removing IL does not prevent a determined attacker from reversing an application. But it creates hurdles that are relevant in a practical sense. It is defense in depth. This is why IL obfuscation products can be rational to use.
A friend of mine has cracked .NET products by decompiling IL to C# and making rather trivial modifications. He is not capable of cracking native applications. It is much harder. He also had to give up in the presence of IL obfuscators because the decompiler tool crashed on those binaries. Again, those products were protected in a practical sense. It worked.
Hex-Rays does a good job for C, and it has macros to help the decision process.
Do you work for Hex-Rays or for a company which sells obfuscation software? It appears that.
Anyway, even if you convert it to C, the code will be far far away from a good C# architecture. Even if you get pieces of the code, you will have to put a good amount of effort on it to change, improve, etc....
If for you the native compilation is irrelevant, ok. But for many people it is relevant.
BTW: You look very interested in keeping with JIT compilation and also you appear to have a lot of experience in disassembling software. I am wondering why and where you had to use that?!
Regardless of how any of you feel about the ease of decompilation of IL vs machine code, it doesn't change the fact that it is a real requirement at real businesses. (And we could argue about how valid or invalid that requirement might be until the cows come home.)
My previous employer explicitly forbade shipping .NET or JVM tools externally for this reason. Right before I left one team convinced the higher ups to let them ship a tool with heavy obfuscation applied, but otherwise we were writing external tools in C++ to satisfy corporate policy.
This discussion has gone way off the rails. If you all wanna have a flamewar about whether AOT is relevant for IP protection, please do it somewhere else.
Reacted by Luxko, Symbai, Stephen Hodgson, Joseph Moreno, ToolGood, Leo Yang and Eduardo Larios
Hex-Rays does a good job for C, and it has macros to help the decision process.
Do you work for Hex-Rays or for a company which sells obfuscation software? It appears that.
Anyway, even if you convert it to C, the code will be far far away from a good C# architecture. Even if you get pieces of the code, you will have to put a good amount of effort on it to change, improve, etc....
If for you the native compilation is irrelevant, ok. But for many people it is relevant.
BTW: You look very interested in keeping with JIT compilation and also you appear to have a lot of experience in disassembling software. I am wondering why and where you had to use that?!
On the contrary, I possess the skills to reverse engineer native code to source code that can be further used by third parties, so I am fully aware that compiling to native code is only an hurdle for script kiddies, which seems to be the missing understanding here.
EDIT: Also stoping my comments. Just wanted to reply to the personal attack.
The results of the survey have been posted - #41522. We are now in the process of following up with people that provided their contact information and have some additional follow-up questions.
Reacted by Symbai and Eduardo Larios
Reacted by Symbai, David Maas, Ben {chmark} Adams and Eduardo Larios
AOT w/ static linking is urgent needed for game engines in iOS and console platform which disable jit,
I totally agree here. As we are in need of a solution for this problem (C# code running on game consoles for a non Unity project) we are using a Mono-AOT based tool chain. But it has some serious limitations and doesn't perform that well.
Therefore we are looking into getting CoreRT running on 3 poplar game consoles (XBox One; PlayStation 4 and Nintendo Switch). An initial prof of concept show that it actually works (still with some limitations) but already with an significant run time performances improvement compared to the Mono based solution.
But with the NDA situation around game consoles official support for this use cause is properly even more far fetched than getting official native AOT in the first place.
@RalfKornmannEnvision Are you using the Xamarin Xbox One/PS4 Mono ports with LLVM codegen?
@RalfKornmannEnvision Are you using the Xamarin Xbox One/PS4 Mono ports with LLVM codegen?
@lateralusX As the integration was done by someone else I don't know any detail. But as far as I know they used the mono ports that are provided for the XBox One/PS4 and made a simple port for the Switch. themself.
@RalfKornmannEnvision Would be great to get in contact and discuss the experience related to this. The LLVM codegen has (depending on project) very positive performance effects on the generated code so if that was not used (needs to be enabled) there is normally a lot to gain by just enabling that. Are you on the DotNetEvolution discord server, if so maybe we could have an offline discussion there related to this?
@lateralusX I am pretty sure the team members who worked on this have enabled the LLVM codegen and tried other things. Their last statement before moving on to another project was that this is the best they could do.
As part of my investigation I build a benchmark with the core component using Xamarin Android and run it on a Tegra X1 based device to see if we lost performances because of an issue with the our custom Switch port of Mono. Unfortunately the performance of the Xamarin project was not that different of what we have seen on the Switch.
I am sorry I am not on this discord server and to be honest their is not that much I know about the current MONO integration anyway. From my point of view it's a dead end anyway for this project. The current CoreRT prototype (while having even less official support) is already far superior when it comes to performances and usability.
Activity
Dotnet-GitSync-Bot commentedon Aug 5, 2020
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Gnbrkm41 commentedon Aug 5, 2020
Looks like a typo -
* 9. Which of these tasks are apart of your production debugging workflow? (Please select all that apply)Maybe it should be "a part of"?Sergio0694 commentedon Aug 5, 2020
I'm so happy to see this issue! 😄🚀
Question: for UWP devs that have worked with the .NET Native toolchain, should we answer the survey just saying we haven't used CoreRT before, or since .NET Native has many similarities (and some shared code too?) with CoreRT, should we just mention this in the notes and then reply the other CoreRT questions just with respect to our experience with .NET Native? 🤔
jeffschwMSFT commentedon Aug 6, 2020
@Sergio0694 thanks for the UWP question. I agree, I think it makes sense to mention that in the notes and reply to the use corert if you had used the open source version.
rgwood commentedon Aug 6, 2020
Thanks for posting this survey!
I was also confused about how to answer certain questions as a UWP dev who has only used .NET Native. I have a number of opinions about UWP’s .NET Native toolchain but I didn’t really see a place to write them down. Totally fine if that’s outside the scope of this survey but it might be worth clarifying.
I also suspect “because .NET Native is the default for UWP release builds and required in the Store” is probably the most common reason why people use AOT but it’s not one of the pre-populated answers for question 5.
jmacato commentedon Aug 6, 2020
Thanks for including Avalonia in the GUI options :) We've experimented with CoreRT+Avalonia before and the results were gorgeous native GUI apps :D though we havent maintained compat since it's been 2 yrs then...
Vincenz099 commentedon Aug 6, 2020
An often forgotten part of .net is game development, a lot of platforms do not allow a JIT to run, think of Consoles or IOS devices.
It is very important for the future of game development to get .net native AOT as a first-class citizen of the .net ecosystem.
Some game engines rolled their own AOT (for example Unity does with il2cpp) but it is an absolute trainwreck.
So an official solution would be more than welcome. It could be a industry changing event.
Don't forget that the game industry is overtaking the filming industry in both profit and turnover.
Consoles is where the main profit is being made.
prajaybasu commentedon Aug 6, 2020
...
I disagree. For the best end user UX, AOT w/ static linking is needed for game engines, serverless microservices, desktop GUI applications, iOS and Android applications, WASM based client side SPAs/libraries and basic CLI tools (~few MBs).
I have wished that I could easily AOT compile my code while trying out all of the above scenarios in C# over the last few years and I feel that .NET is missing out heavily compared to LLVM based languages like Rust.
The reason why the current publishing options appear to "work well' is because .NET has historically not been suitable for the above scenarios and people just implement their own AOT (e.g.: Unity, UWP, Mono) when using C#. Partial AOT solutions such as native image (e.g., ReadyToRun) might "help" in cold start scenarios for monolithic server applications or large desktop client applications but the binary size is still many times larger than what a full AOT runtime would produce.
.NET already does not "work well" for serverless/containerized microservices - these could heavily benefit from AOT compilation, reduced binary size and minimal dependencies.
The current ReadyToRun + Tiered Compilation + IL Linker solution has already hit a limit for the file size which is annoying for self contained deployments, such as the one recommended by AWS Lambda in their blog post.
The real issue is that there's currently too many runtimes/code generators/toolchains/experiments available with their own quirks: IL2CPP/Burst (Unity), Mono's AOT backend (Xamarin/Blazor/Uno), .NET Native/CoreRT (UWP), Mono's LLVM backend, CrossGen/ReadyToRun (.NET Core), etc. and it's simply unacceptable that .NET does not have a standardized AOT compilation toolchain.
If all these teams combined their engineering effort on something common such as CoreRT, Mono LLVM backend or the now-abandoned dotnet/lilic then AOT would have been a much better experience for .NET devs.
AOT w/ static linking is accessible to a large number of developers now with CI/CD for the masses and it is not just an annoyance for a marginal increase in performance anymore.
C# endgame: Native code, native UI, fast and easy interop, native exports and performance oriented APIs (e.g., System.IO.Pipelines, System.Text.Json).
phil-harmoniq commentedon Aug 6, 2020
I disagree with the statement saying webapps wouldn't benefit from this. AOT would help greatly with serverless workloads (aka Azure Functions). Not to mention the benefits from startup time for CLI tools.
pjmlp commentedon Aug 6, 2020
I have answered the survey, but to be honest I don't get this continuous asking of surveys since .NET Core 1.0 started, without a clear direction where things are going.
.NET Native is what .NET should have been all along, back when Ext-VOS project started, and there is the experience from Singularity and Midori that you guys can certainly relate to, or even get some internal servers with them going on.
Even Java has decided to catch up with its missing AOT capabilities the team isn't asking what workloads we want to have it working.
We hardly use NGEN, because since .NET release its code quality generation was never improved and the deployment workflow is a pain versus other AOT compiled languages.
So if going forward, AOT is dropped again from .NET consider that all the competition in managed languages is now focusing in AOT toolchains, and they also don't ask which workflows we would like to use the compiler.
I want to see .NET continuing to flourish and being the first option regardless of the scenario, and if anything to take over workflows where Microsoft still forces us to use C++ alongside .NET, which other AOT compiled languages don't have issues with.
33 remaining items
GSPP commentedon Aug 21, 2020
Security is not all or nothing. Removing IL does not prevent a determined attacker from reversing an application. But it creates hurdles that are relevant in a practical sense. It is defense in depth. This is why IL obfuscation products can be rational to use.
A friend of mine has cracked .NET products by decompiling IL to C# and making rather trivial modifications. He is not capable of cracking native applications. It is much harder. He also had to give up in the presence of IL obfuscators because the decompiler tool crashed on those binaries. Again, those products were protected in a practical sense. It worked.
pjmlp commentedon Aug 21, 2020
@Symbai
Have you ever seen a tool like dnSpy for C++ code? Delphi code?Hex-Rays does a good job for C, and it has macros to help the decision process.
Having C source it is a kids play to convert it to C++ or Delphi.
Plus now we have AI to help those not skillful enough.
Neural Reverse Engineering of Stripped Binaries
ccarlo88 commentedon Aug 21, 2020
Do you work for Hex-Rays or for a company which sells obfuscation software? It appears that.
Anyway, even if you convert it to C, the code will be far far away from a good C# architecture. Even if you get pieces of the code, you will have to put a good amount of effort on it to change, improve, etc....
If for you the native compilation is irrelevant, ok. But for many people it is relevant.
BTW: You look very interested in keeping with JIT compilation and also you appear to have a lot of experience in disassembling software. I am wondering why and where you had to use that?!
PathogenDavid commentedon Aug 21, 2020
Regardless of how any of you feel about the ease of decompilation of IL vs machine code, it doesn't change the fact that it is a real requirement at real businesses. (And we could argue about how valid or invalid that requirement might be until the cows come home.)
My previous employer explicitly forbade shipping .NET or JVM tools externally for this reason. Right before I left one team convinced the higher ups to let them ship a tool with heavy obfuscation applied, but otherwise we were writing external tools in C++ to satisfy corporate policy.
This discussion has gone way off the rails. If you all wanna have a flamewar about whether AOT is relevant for IP protection, please do it somewhere else.
pjmlp commentedon Aug 21, 2020
On the contrary, I possess the skills to reverse engineer native code to source code that can be further used by third parties, so I am fully aware that compiling to native code is only an hurdle for script kiddies, which seems to be the missing understanding here.
EDIT: Also stoping my comments. Just wanted to reply to the personal attack.
ihlong commentedon Aug 27, 2020
Cloud Native and WPF Must be AOT.
Windows client no runtime ! no JIT
jeffschwMSFT commentedon Aug 28, 2020
The results of the survey have been posted - #41522. We are now in the process of following up with people that provided their contact information and have some additional follow-up questions.
lateralusX commentedon Aug 28, 2020
@RalfKornmannEnvision Are you using the Xamarin Xbox One/PS4 Mono ports with LLVM codegen?
RalfKornmannEnvision commentedon Aug 31, 2020
@lateralusX As the integration was done by someone else I don't know any detail. But as far as I know they used the mono ports that are provided for the XBox One/PS4 and made a simple port for the Switch. themself.
lateralusX commentedon Aug 31, 2020
@RalfKornmannEnvision Would be great to get in contact and discuss the experience related to this. The LLVM codegen has (depending on project) very positive performance effects on the generated code so if that was not used (needs to be enabled) there is normally a lot to gain by just enabling that. Are you on the DotNetEvolution discord server, if so maybe we could have an offline discussion there related to this?
RalfKornmannEnvision commentedon Aug 31, 2020
@lateralusX I am pretty sure the team members who worked on this have enabled the LLVM codegen and tried other things. Their last statement before moving on to another project was that this is the best they could do.
As part of my investigation I build a benchmark with the core component using Xamarin Android and run it on a Tegra X1 based device to see if we lost performances because of an issue with the our custom Switch port of Mono. Unfortunately the performance of the Xamarin project was not that different of what we have seen on the Switch.
I am sorry I am not on this discord server and to be honest their is not that much I know about the current MONO integration anyway. From my point of view it's a dead end anyway for this project. The current CoreRT prototype (while having even less official support) is already far superior when it comes to performances and usability.
lateralusX commentedon Aug 31, 2020
@RalfKornmannEnvision OK, thanks for your information and feedback, all very valuable.