iowait kills performance on Android

1.4k Views Asked by At

This is on Android, my application slows down the UI interaction when it is trying to create a big file, my SD card is slow and I can observe that high iowait occurs and the CPU just sits idle when creating the big file, during this process, the application is sluggish, UI interaction is unresponsive, this looks normal since my SD card is slow and this is what is expected with high iowait.

I read somewhere that as long as one uses asynchronous IO, iowait will not impact the performance of the application, now one thing that I don't quite understand is that I am creating the big file in a background thread, which is concurrently running alongside with the UI thread and I think shouldn't block the UI thread. Yes, I am not using Java non-blcoking IO APIs, but isn't it enough to be asynchronous by using a background thread?

P.S. I am creating the big file by opening a RandomAccessFile and seeking to a specified position.

0

There are 0 best solutions below