Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Android emulation (I've tried both the bundled emulator and VirtualBox+RemixOS) is the most insanely slow piece of software I've ever seen in my life. It feels like if I were running Windows10 on an original 80386. My laptop is Core2Duo with 4GB RAM, IntelliJ IDEs and everything work great (especially after I've upgraded my HDD to an SSD), desktop and server OSes work great in VirtualBox but Android feels like playing chess via mail. Why does it have to be heavier than desktop Linux&Java?

I don't want to upgrade the PC as I love it the way it is and it's enough for everything else. I feel like I'd like to make a simple app for my phone occasionally (just for fun and to make something in my life easier) but emulation seems impossible.



>My laptop is Core2Duo with 4GB RAM

i'm with you that android emulation is pretty slow, but your machine is reaching near parity with many of the devices that run the platform you're trying to emulate.

it's nearly always the case that an emulator host has to have a significant performance margin over the guest just to account for the inaccuracies/inconsistencies/hacks that are involved in mimicking a system on a dissimilar hardware platform.


I would be Ok emulating the slowest Android phone of those which existed some years ago - I bet it was much weaker than my actual laptop yet not nearly as slow as an emulation I actually get. I'm not interested in using NDK, 3D graphics or any bells-and-whistles in my Android apps.


Make sure to customize the AVD then and use a much lower resolution. If you pick a default like the Pixel 3 it'll be running at a resolution that really doesn't work if you're trying to share 4GB of RAM with a host OS, IDE, and whatever else you have open.

EDIT: Also make sure you've enabled VT-x if your laptop has it.


If you're targeting a fairly old Android release, that would probably be ok. But I'd bet to get decent performance on your hardware, you'd have to emulate a low-RAM, single-core phone that probably wouldn't be able to run a current Android release.


Most Android phones nowadays have more RAM than your laptop. That CPU is also 10+ years old and a phone running a Snapdragon 855 or 865 is going to perform 2-5x better depending on which exact chip you have and single vs multi core benchmarks. The Android emulator may not be the fastest thing in the world, but your 10 year old computer is certainly not helping.


I've never actually seen a smartphone with more than 4GB of RAM (mine has 2 GB and runs Android 9 in FullHD with perfect performance). Whatever, a huge amount of ram usually is used when running heavy apps. Running the basic system + a small app isn't supposed to take anything near 100% RAM or CPU.

An Android app I want to write is going to be a single form with some text fields and some buttons, it will have simple logic but it needs to run in background, be able to read a sensor, read/write some SQLite/CSV data and play a sound occasionally. No fancy graphics bells and whistles.

This seems like a very simple task to handle, I bet it's not going to take much RAM or CPU.

Why is it so hard to emulate?


  - Galaxy S9+ (2018): 6GB
  - Galaxy S10 (2019): 6 or 8 GB
  - Galaxy S10+ (2019): 8 or 12 GB
  - Galaxy S20 (2020): 8 or 12 GB
  - Galaxy S20 Ultra (2020): 12 or 16 GB
  - OnePlus 3 (2016): 6 GB
  - OnePlus 8 (2020): 8 or 12 GB
  - LG G7 ThinQ (2018): 4 or 6 GB
  - LG Velvet (2020): 8GB  
  - Pixel 4 (2019): 6GB
  - Xiaomi Pocophone F1 (2018): 6 or 8GB
  - Huawei Mate 20 (2018): 4 or 6 or 8GB
  - Sony Xperia 1 (2019): 6GB 
  - Moto Razr (2020): 6GB
Pretty much every Android phone maker is producing phones with at least 6GB of memory now. The flagships are heading toward 12 and 16GB now. OnePlus had more than 4GB almost 4 years ago. Only Apple, who has the benefit optimizing its OS for a small set of hardware, seems to still be running on 4GB or less on all of its phones

You're trying to emulate an entire OS here. Android 10 requires a minimum of 2GB of RAM just on its own now. You have overhead for the emulation software itself on top of that, in addition to the memory needed by your computer's OS, your IDE, your browser, etc. Android Studio alone requires a minimum of 1GB and, at least in my experience, it will use that within 5 minutes of opening up.

Not to mention, even budget phones today are at least twice as fast as the CPU you're running.

You can't expect emulated software to run well on a computer that barely even meets the minimum requirements for that software. It's ludicrous.


> Pretty much every Android phone maker is producing phones with at least 6GB of memory now

Ok. I can see no reason to care about such though. What the heck do they need that for?

> You're trying to emulate an entire OS here.

But I emulate desktop Linuxes and Windows without problems - that's entire OSes too.

> Android 10 requires a minimum of 2GB of RAM just on its own now.

Why? What does it need this much for? Anyway, I can reserve 2GB of RAM now and I'm sure I'm not going to notice too much drop in performance.

> You can't expect emulated software to run well on a computer that barely even meets the minimum requirements for that software. It's ludicrous.

As for the app - I'm sure it can't require anything near that much. As for the OS - why does Android have to require so much more than Linux and Windows do?

BTW my actual phone (Galaxy Note 3) runs Android 9 on 3 GB RAM perfectly. I never tried 3D games but everything else is blazing fast. I've been updating it (Android 4-5-6-9) for years and never noticed a glitch.


> Ok. I can see no reason to care about such though. What the heck do they need that for?

> Why? What does it need this much for?

As a developer, that shouldn't matter to you. Only that it _does_ require that much. You can assume that your users will have 4GB of memory in almost all cases now, whether you agree with it or not. Your opinion on the _why_ is irrelevant, frankly.

If you can't provide that much to the emulator, you can't expect to run it smoothly. There is no magic solution to this. These things require resources that your computer does not have. If you want it to run better (or even at all), get better hardware. That's all there is to it.


>My laptop is Core2Duo

Core2Duo was released over 13 years ago, and discontinued over 7 years ago.

Time to think about upgrading before complaining about performance issues. Especially for emulation.


Why, if absolutely everything except Android emulation (desktop Linux and Windows emulation work fine) and recent games (in which I am not interested) work perfectly? I've just replaced my HDD with an SSD a couple of years ago and it feels like a new PC again. I never experience even slightest discomfort when I'm not trying to emulate Android.


Because emulation is a heavy operation. Be realistic.

Also I don't believe that PC isn't painful to use for everything else. I had a core2duo a while back and it was slowish back then.


> Because emulation is a heavy operation. Be realistic.

Then why is desktop Linux and Windows emulation not nearly as slow? Windows 7+ emulation is slightly slow, especially running VisualStudio on an emulated Windows7 is painfully slow (while perfectly swift on non-emulated) but still usable if you have enough patience (Android emulation is absolutely unusable). Emulated (VirtualBox on a Linux host) Windows XP runs even faster than on bare metal.

> Also I don't believe that PC isn't painful to use for everything else. I had a core2duo a while back and it was slowish back then.

You probably did something wrong. It's not just painless, it's perfectly swift (both with the latest KDE Plasma and with Windows 7). I have a modern PC at the office (late pre-Ryzen AMD, 8GB RAM, Win10) and its perceived performance is the same. It even feels more slow (less responsive) than the Core2Duo occasionally but I blame that to Windows10.

Of course I only mean basic tasks like browsing the web, watching videos (1080p or less), juggling files and writing code (VisualStudio, IntelliJ) for small projects. Obviously any modern CPU will beat Core2Duo in video transcoding, modern games etc.


Even a current i5 is more than double as fast per core, and likely has 12 threads instead of 2. So as a roundabout figure let's say 8x the effective speed.

VT-D makes your Core2Duo better able to emulate Windows or Linux in hardware, but not Android.

Like I said, I don't believe that a Core2Duo isn't slow for everything you mentioned. I had one at home. I wasn't doing anything wrong - I know how fast it isn't - we had hundreds at my work. Have you noticed that other commenters are saying the same thing about Core2Duo speed as me? You must have more patience to wait for your PC than myself and the other commenters.

The reason I replaced my Core2Duo was because it was slow, and I replaced it around 8 years ago!


I'm sorry but I refuse to believe that you're having a great experience using IntelliJ IDEA with a Core2Duo and 4GB RAM.


I only used it for Scala, never actually written anything beyond a Hello World in Java. Perhaps Scala takes less resources. I also use PyCharm actively and it works much faster on Linux than on Windows (on Windows it indeed is slow).


Yeah, I struggle to keep my RAM usage in PhpStorm below 1.5GB. And that's with me policing its indexing and what plugins are installed. There's no way that's a good experience.


It can be fine on smaller to medium projects (not much to index).


Core2Duo laptop for Android dev is almost same thing like using 80386.


Why does Android dev has to be this much heavier than any other task? I'm ok doing .Net, Scala and Python dev (always using the most powerful IDEs), some lo-fi machine learning, running Windows and Linux and heavy Windows apps in VirtualBox, but Android - can't emulate.

What I have resorted to is writing single-page JavaScript apps and running them in the browser so I can debug them in the host browser instead of an emulator.


Remember that we're talking about emulating an entire system here, which is very different from running an IDE (even considering that an IDE like IntelliJ is pretty heavy-weight).

Windows and Linux themselves in a VM is probably reasonably ok on your hardware because both of those OSes are built to run on non-current hardware (especially Linux; I'm running Debian buster with a current kernel on a circa 2010 single-core ARMv5 CPU with 256MB of RAM with no problems).

Android doesn't target old hardware; I wouldn't expect a current release to run all that well even on a four-year-old phone, let alone a 10+-year-old laptop with virtualization overhead.

Also the usual stuff applies: be sure you have your system's virtualization extensions enabled if it has any, use the x86 Android emulator image with hardware accel enabled, not the ARM one, etc. But that still may not be enough.


> circa 2010 single-core ARMv5 CPU with 256MB of RAM

Just curious, which board is that?


How are you doing all of those things with only 4GB of memory? My wife's old laptop had 3GB, and with about 10 Chrome tabs open, the computer would start swapping and quickly grind to a halt—with no other programs running in the foreground. I just checked memory usage on my own machine and Firefox alone is using over 3GB for me, and IntelliJ another 4GB. Granted, I know many programs tend to use more memory if it's available (for caching, etc), and I also hardly ever restart my machine, but still... Running a full dev environment with 4GB doesn't seem like it should be possible, so I'm curious how yours is so functional.


I usually have about 50 open Chrome tabs (on my Core2Duo with 4GB RAM). Half of them YouTube (I mostly watch 360p though, I only switch to 1080p when I watch somebody coding). This could get slightly slow occasionally when I used a HDD, not even slightly slow now as I switched to an SSD. I usually have PyCharm open so I code at the same time while watching something. I only experience some minor slowness when I run a system (Manjaro) update in the background and when PyCharm re-indexes libraries after an update.


Does your Core 2 Duo processor support hardware virtualization extensions (VT-x)? Some do, some dont. If it doesnt, you'd get no acceleration in the Android Emulator, so it would be expected to be pretty slow.


Mine does and I wouldn't be shocked by Android being that slow if normal Linuxes didn't work perfectly. People say that's because Android lacks proper virtual video card drivers.


Modern Android devices have almost similar (or sightly less on low-end) specs as your laptop. And your laptop should run IDE and emulator. No reason to run comfortably.


You miss a point: an app I need to run in the emulator is extremely simple, almost "hello world"-like. The OS itself shouldn't take much resources. I would expect 99% of the CPU and 80% of the RAM to be unused when running such a humble app on a bare OS. Another point is I actually have VT-x so x86 Linux and x86 Windows can normally be emulated without much overhead but x86 Android is a different story.


It sounds to me like you had the emulator setup incorrectly TBH. It's bad but not that bad. Make sure you're using an x86 image, have hardware emulation enabled, have the virtualization drivers installed, etc etc.


Realistic hardware emulation is way cheaper than actual hardware. You can buy yourself 32 GB of RAM or you can buy dozens of test devices.


You can buy yourself 32 GB of RAM only if your motherboard chipset supports that much. If it does - then that can be really cheap, especially if you consider buying used RAM - it usually works ok forever once it passes MemTest86+.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: