--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgkdBMKF0%3D_wkAioBHSiLBE0Y0haPYNcQUNvViCgcYKHXQ%40mail.gmail.com.
On Fri, 28 May 2021 at 11:17, John Dallman <jgdats...@gmail.com> wrote:Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell.At present, I am only producing software for 64-bit ARM, because none of the customers wanted 32-bit code. Now, however, a customer is asking for x86-64 code, because it will run faster in the emulator, and they apparently have automated testing for their app in the emulator, but not on-device.
Which emulator? This is the key question. Android emulators actually run arm code faster in many ways. Android is essentially an SE Linux distro, so it depends on your deployment target.
https://en.wikipedia.org/wiki/Hardware-assisted_virtualization
Things I'd like to check, before I do this:
- As far as I've been able to discover, there are very few x86-64 Android devices on the market. Correct?
Yes they are quite rare nowadays.
- However, most current Chromebooks are x86-64-based, and Android apps that use native code will run faster on them if they include x86-64 versions of the native code. Correct?
Probably not. It will depend on the hardware virtualisation in the CPU. The notion that x86 emulation is faster isn't really true anymore, but it depends on which emulator you're using.
- It would be possible to produce an ASOP-based x86-64 OS for conventional PCs, but nobody seems to do this at present. Correct? I'm not going to try: not my field of expertise.
Yes.
- Testing x86-64 code in the emulator is good for testing UI and logic development, but can't provide the same assurance that the ARM64 code will work as testing ARM64 code would, because there's always the possibility of different compiler behavior. Correct?
Depends on the emulator. Are you using a linux VM? Virtualbox? VMWare? The emulator itself will make more of a difference in speed than the native code.
- Google has no announced plans to drop x86-64 support from NDK, and it does not seem likely that such plans would happen in the near future. Correct?
No but they seem to be edging away from it slowly but surely.Thanks in advance,John Dallman
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAAjyq-dNfCfX2vSxc%2BU%3Dh18doSRXyNwTr%2B0i1divZQ%2B6ze4Xcw%40mail.gmail.com.
Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell.At present, I am only producing software for 64-bit ARM, because none of the customers wanted 32-bit code. Now, however, a customer is asking for x86-64 code, because it will run faster in the emulator, and they apparently have automated testing for their app in the emulator, but not on-device.
Things I'd like to check, before I do this:
- As far as I've been able to discover, there are very few x86-64 Android devices on the market. Correct?
John Dallman
Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell.At present, I am only producing software for 64-bit ARM, because none of the customers wanted 32-bit code. Now, however, a customer is asking for x86-64 code, because it will run faster in the emulator, and they apparently have automated testing for their app in the emulator, but not on-device.Things I'd like to check, before I do this:
- As far as I've been able to discover, there are very few x86-64 Android devices on the market. Correct?
- However, most current Chromebooks are x86-64-based,
- and Android apps that use native code will run faster on them if they include x86-64 versions of the native code. Correct?
- It would be possible to produce an ASOP-based x86-64 OS for conventional PCs, but nobody seems to do this at present. Correct? I'm not going to try: not my field of expertise.
- Testing x86-64 code in the emulator is good for testing UI and logic development, but can't provide the same assurance that the ARM64 code will work as testing ARM64 code would, because there's always the possibility of different compiler behavior. Correct?
- Google has no announced plans to drop x86-64 support from NDK, and it does not seem likely that such plans would happen in the near future. Correct?
Thanks in advance,John Dallman
On Fri, 28 May 2021 at 11:17, John Dallman <jgdats...@gmail.com> wrote:
At present, I am only producing software for 64-bit ARM, because none of the customers wanted 32-bit code. Now, however, a customer is asking for x86-64 code, because it will run faster in the emulator, and they apparently have automated testing for their app in the emulator, but not on-device..
Which emulator? This is the key question. Android emulators actually run arm code faster in many ways. Android is essentially an SE Linux distro, so it depends on your deployment target.
https://en.wikipedia.org/wiki/Hardware-assisted_virtualization
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAP5h4q_ipiKnSxMJTNS6Zp8gJJnOW2x_9Do0CGA7jkjDiHHxDA%40mail.gmail.com.
(since there seems to be a lot of confusion about emulation and virtualization from others who've responded...)On Fri, May 28, 2021 at 2:17 AM John Dallman <jgdats...@gmail.com> wrote:
- As far as I've been able to discover, there are very few x86-64 Android devices on the market. Correct?
you can actually work out the numbers for yourself in the Play Developer Console, if you play with the controls that let you allow/deny various devices :-)
by number of SKUs or by volume? higher-end Chromebooks are usually x86-64 while the cheapest ones are usually ARM.
perhaps more interestingly, the main impediment to running x86-64/bionic code on your desktop is that the PT_INTERP in the ELF header says "/system/bin/linker64". if you set up a chroot or symlinks on your desktop so that you have /system/bin and /system/lib64 you can actually run command-line stuff just fine on the host. we sometimes do this for the bionic tests, for example.
the big saving here is that you don't have to transfer code via adb.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZoouXp9-kNLw-gjC7YUmhaLF7eeUuvdghq5S9pUH2Cv3Zw%40mail.gmail.com.
On Sun, May 30, 2021 at 8:21 AM Alias R. Cummins <alia...@gmail.com> wrote:On Fri, 28 May 2021 at 11:17, John Dallman <jgdats...@gmail.com> wrote:At present, I am only producing software for 64-bit ARM, because none of the customers wanted 32-bit code. Now, however, a customer is asking for x86-64 code, because it will run faster in the emulator, and they apparently have automated testing for their app in the emulator, but not on-device..Which emulator? This is the key question. Android emulators actually run arm code faster in many ways. Android is essentially an SE Linux distro, so it depends on your deployment target.
https://en.wikipedia.org/wiki/Hardware-assisted_virtualizationThe emulator supplied with the Android development tools, I presume. I do all my Android work on Linux. I also do straight Linux builds of the same libraries, but they are quite separate, and not part of this discussion. I don't understand very much about modern emulators, but I think there's a misunderstanding somewhere in my question and your reply.I have three potential situations here:
- ARM64 code for Android, running on an ARM64 Android device.
- The same ARM64 code for Android, running in the Android emulator on an x86-64 Linux machine.
- The sane source code, compiled for x86-64 Android, running in the Android emulator on the same x86-64 machine.
Clearly, the relative performance of cases 1 and 2 depends on the relative performance of the Android device and the Linux machine. Since my testing workload is quite large and computationally intensive, I make sure to have fast devices. Currently I have Black Shark 2 'phones, and I'm trying to buy Black Shark 4 Pros.However, it seems implausible to me that case 2 can be faster than case 3, but that's what you seem to be saying above. Where's the misunderstanding?Hardware-assisted virtualization doesn't overcome a different instruction set, AFAICS.
For the avoidance of doubt, I am not doing builds in Android Studio, or CMake: I'm using my employer's build system for UNIX-like OSes, which gives me complete control over what I'm compiling, because I'm using Clang directly, from its command line. I am only generating ARM64 code; there is nothing adding x86-64 code to my builds.If I end up doing Android x86-64 builds, they will be entirely separate from the ARM64 Android builds.John
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgnnnkGd8s6fWzJfqX35-K%3DN4yQSn3gKz8H3eri9zyt8%2BQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZorab8bqTc3x5U_Tqf_D1x489qcppkYR-feEtGpZcQQfdg%40mail.gmail.com.
On Fri, May 28, 2021 at 2:17 AM John Dallman <jgdats...@gmail.com> wrote:Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell.At present, I am only producing software for 64-bit ARM, because none of the customers wanted 32-bit code. Now, however, a customer is asking for x86-64 code, because it will run faster in the emulator, and they apparently have automated testing for their app in the emulator, but not on-device.
perhaps more interestingly, the main impediment to running x86-64/bionic code on your desktop is that the PT_INTERP in the ELF header says "/system/bin/linker64". if you set up a chroot or symlinks on your desktop so that you have /system/bin and /system/lib64 you can actually run command-line stuff just fine on the host. we sometimes do this for the bionic tests, for example.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZooa3415%2BncLgLon0AALwdkP5HC3ik2dvCXvdq9Kn-xWXw%40mail.gmail.com.
Running the CPUs at full speed for 12-18 hours a day on Android devices is causing breakdowns due to bulged batteries.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgnCwmK%3DAuU9L6J%3Dn2Nzmd0EGTqPkWWWd9HeKWt4Ox1q2A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGht265JDc0UVU7fszA%2BTWAvd6wSO%3DquZxOGkOpu28S_ZOg%40mail.gmail.com.