-
Notifications
You must be signed in to change notification settings - Fork 526
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
[monodroid, Xamarin.Android.Build.Tasks] Interpreter support (#4618) #4618
Conversation
b973b9c
to
19fcbca
Compare
Options:
|
@jonp I'd use |
abiName: AbiNames.TargetJit.AndroidX86, | ||
interpreter: true, | ||
enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidX86) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alas we do not support the interpreter on x86
.
Is this fairly common? Or does everyone use x86_64
anyway as emulator?
Edit: I just saw we ship the x86 interpreter bits in the Mono SDK 😅 that will assert on startup though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually use x86
emulators on CI...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant with "everyone" the average Xamarin.Android developer 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Developers will most definitely run emulators using either x86
or x86_64
images, but I don't know which one of those is more popular. Both are accelerated and x86_64
can run x86
apps, so I'd hope that this one's more popular, but that's just my hope not supported by any data :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I created mono/mono#19669
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most devs use x86 right now as Visual Studio suggests it by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lewurm x86 is like 90% with x86_64 in the < 10% range. ARM even lower here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ABI/CPU -
88/10/3/2% for x86/x86_64/armeabi-v7a/arm64-v8a on Mac.
90/7/1/1% for x86/x86_64/armeabi-v7a/arm64-v8a on Windows.
1452d6e
to
48e0302
Compare
Doesn't work yet - XA runtime is not placed in the `interpreter-` dirs yet
Context: https://www.mono-project.com/news/2017/11/13/mono-interpreter/ Add *experimental* support to use [Mono's IL interpreter][0] instead of using the JIT or (Hybrid)AOT backends by setting the `$(_AndroidUseInterpreter)` MSBuild property to True. This is a proof-of-concept to explore how the interpreter backend performs compared to the JIT backend at various tasks. It is not currently intended for production use. Note that Mono's IL interpreter does *not* currently support running on x86 targets. Issue an XA0124 error if the interpreter is enabled when targeting x86 devices. One "interesting" -- but not explored -- result is that startup time is [*reduced* when using the interpreter][1]; on a Pixel 3 XL launching a arm64-v8a build of `tests/Xamarin.Forms-Performance-Integration`: | Description | native-to-managed | Runtime.init | ActivityDisplayed | |------------:|------------------:|-------------:|------------------:| | JIT | 53.660 ms | 92.821 ms | 1091.30 ms | | Interpreter | 32.019 ms | 112.288 ms | 897.50 ms | Here, native-to-managed time and ActivityDisplayed times are reduced, while `Runtime.init()` time is increased. We did not explore why this would be the case, or what other performance changes would be present after app startup. [0]: https://www.mono-project.com/news/2017/11/13/mono-interpreter/ [1]: https://gist.github.com/grendello/3510f2c0621eb360cd063d6c00b4b1e8#file-results-md
Context: https://www.mono-project.com/news/2017/11/13/mono-interpreter/
Add experimental support to use Mono's IL interpreter instead
of using the JIT or (Hybrid)AOT backends by setting the
$(_AndroidUseInterpreter)
MSBuild property to True.This is a proof-of-concept to explore how the interpreter backend
performs compared to the JIT backend at various tasks. It is not
currently intended for production use.
Note that Mono's IL interpreter does not currently support running
on x86 targets. Issue an XA0124 error if the interpreter is enabled
when targeting x86 devices.
One "interesting" -- but not explored -- result is that startup time
is reduced when using the interpreter; on a Pixel 3 XL launching
a arm64-v8a build of
tests/Xamarin.Forms-Performance-Integration
:Here, native-to-managed time and ActivityDisplayed times are reduced,
while
Runtime.init()
time is increased.We did not explore why this would be the case, or what other
performance changes would be present after app startup.