简体   繁体   中英

Does Android apk size affect app performance?

I use an OCR library inside my app. The "OCR.so" library is loaded only if the user selects OCR option. This OCR library has increased my apk file size from 700KB to 4.7MB. I would like to know whether this increase in apk size will have an impact on the performance of the app even for cases when the user is not selecting the OCR option?

In other words, the apk size is 4.7MB, but if I am not calling System.loadLibrary("OCR"), will the apk size have any impact on the performance of the app due to memory constraints?

The OS does not allocate memory depending on the apk file size. APK file is nothing but a zip file which is extracted into a folder during installation. When an App is opened, the OS loads the first executable file which in your case would be the main native library. Then which the native library loads other libraries, the other library files also get loaded. Otherwise, if you don't call system.loadlibrary, the OS won't load it to memory.

There will definitely be a latency. Let me explain it in simple words - memory allocation. When an app is started, OS evaluates, optimizes and allocates memory to process, higher the size more the constraints and more the latency for startup.

Now, during the app lifetime after startup, depends on a lot of factors. But in short lower the apk better it is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM