Skip to content

Survey: Native AOT #40430

Closed
Closed

Description

@jkotas

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.

Survey: https://www.surveymonkey.com/r/7THQK5K

Thank you for your time!

Activity

  1. Dotnet-GitSync-Bot commented on Aug 5, 2020

    @Dotnet-GitSync-Bot
    Collaborator

    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.

  2. added
    untriaged
    on Aug 5, 2020
  3. added this to the Future milestone on Aug 5, 2020
  4. pinned this issue on Aug 5, 2020
  5. Gnbrkm41 commented on Aug 5, 2020

    @Gnbrkm41
    Contributor

    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"?

  6. Sergio0694 commented on Aug 5, 2020

    @Sergio0694
    Contributor

    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? 🤔

  7. jeffschwMSFT commented on Aug 6, 2020

    @jeffschwMSFT
    Member

    @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.

  8. removed
    untriaged
    on Aug 6, 2020
  9. rgwood commented on Aug 6, 2020

    @rgwood

    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.

  10. jmacato commented on Aug 6, 2020

    @jmacato

    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...

  11. Vincenz099 commented on Aug 6, 2020

    @Vincenz099

    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.

  12. prajaybasu commented on Aug 6, 2020

    @prajaybasu

    The existing options for optimizing published applications work well for most scenarios that .NET targets today.

    ...

    AOT mostly matters in GUI apps. That's where it needs focus. I don't see webapp, services, etc. needing that

    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).

  13. phil-harmoniq commented on Aug 6, 2020

    @phil-harmoniq

    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.

  14. pjmlp commented on Aug 6, 2020

    @pjmlp

    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.

  15. 33 remaining items

  16. GSPP commented on Aug 21, 2020

    @GSPP

    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.

  17. pjmlp commented on Aug 21, 2020

    @pjmlp

    @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

  18. ccarlo88 commented on Aug 21, 2020

    @ccarlo88

    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?!

  19. PathogenDavid commented on Aug 21, 2020

    @PathogenDavid
    Contributor

    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.

  20. pjmlp commented on Aug 21, 2020

    @pjmlp

    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.

  21. unpinned this issue on Aug 25, 2020
  22. ihlong commented on Aug 27, 2020

    @ihlong

    Cloud Native and WPF Must be AOT.
    Windows client no runtime ! no JIT

  23. jeffschwMSFT commented on Aug 28, 2020

    @jeffschwMSFT
    Member

    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.

  24. lateralusX commented on Aug 28, 2020

    @lateralusX
    Member

    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?

  25. RalfKornmannEnvision commented on Aug 31, 2020

    @RalfKornmannEnvision
    Contributor

    @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.

  26. lateralusX commented on Aug 31, 2020

    @lateralusX
    Member

    @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?

  27. RalfKornmannEnvision commented on Aug 31, 2020

    @RalfKornmannEnvision
    Contributor

    @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. 

  28. lateralusX commented on Aug 31, 2020

    @lateralusX
    Member

    @RalfKornmannEnvision OK, thanks for your information and feedback, all very valuable.

  29. ghost locked as resolved and limited conversation to collaborators on Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions