Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for native-aot? #59

Closed
queequac opened this issue Feb 11, 2021 · 10 comments
Closed

Support for native-aot? #59

queequac opened this issue Feb 11, 2021 · 10 comments

Comments

@queequac
Copy link

Could not find any reference or statement, but will Xamarin for .NET 6 support Native-AOT?

@jonathanpeppers
Copy link
Member

This isn't complete yet, but this is being worked on here: xamarin/xamarin-android#5539

@queequac
Copy link
Author

Is that one related to dotnet's upcoming Native-AoT? (Formerly known as CoreRT, committed for dotnet 6 and developed in https://github.com/dotnet/runtimelab/tree/feature/NativeAOT)
Not sure about this after reading through the referenced item, since it mentions MonoAOT and comparable several times.🤔

@jonathanpeppers
Copy link
Member

I think this will be based on Mono's AOT -- specific for iOS and Android.

@queequac
Copy link
Author

I see, thanks for the clarification.
Is there some documenttion or additional material? Would be interesting to have a comparison of both AOT approaches... and why iOS and Android won't make use of the same native AOT compiler that will ship with .NET6+.

@jonathanpeppers
Copy link
Member

iOS and Android will use the Mono runtime instead of CoreCLR, and so that is why they would also use the Mono AOT compiler.

I don't know when CoreCLR would be able to run on iOS or Android -- or if that will even happen at all.

If there are docs, you might check the dotnet/runtime repo, one I found:

https://github.com/dotnet/runtime/blob/master/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/README.md

@queequac
Copy link
Author

I see, thanks for pointing this out.

To be honest, I was hoping for "CoreRT" (now called NativeAOT for dotnet6 and not relying on CoreCLR), which is really rocking fast, especially wrt to cold start. But of course it would lack all native bindings for Android, which could be one of the most costly parts when trying to bring this to Android.

@hez2010
Copy link

hez2010 commented Mar 12, 2021

Mono aot is slow at both startup speed and runtime performance, really hope that MAUI can make use of NativeAOT (previously named CoreRT) instead of mono aot in the future.

@chucker
Copy link
Contributor

chucker commented May 24, 2021

Native-AoT? (Formerly known as CoreRT, committed for dotnet 6

I don't think it's committed for anything; the project lists it as an an "experimental fork".

.NET 6 mobile (née Xamarin) still uses Mono's runtime (albeit now with .NET 6's BCL instead of Mono's).

@jonathanpeppers
Copy link
Member

iOS has had AOT in .NET 6 for a while, because it is required for devices.

We just landed Android AOT, which should ship in .NET 6 Preview 7: xamarin/xamarin-android#5539

You use the <RunAOTCompilation>true</RunAOTCompilation> for a Release build to try it out. This enables the <MonoAOTCompiler/> MSBuild task.

I think that solves the original question? Closing, thanks.

@trampster
Copy link

The original question was about NativeAOT (was CoreRT), which is vastly better than Android AOT.
NativeAOT is full AOT solution that massively reduces the deployment size. Andorid AOT makes your deployment bigger.

I think the answer however is no because in NativeAOT is an experiment and is not support on arm yet let alone Android. And Maui still uses the mono runtime even in .Net 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants