Customers are experiencing significant and unexpected performance issues in their applications running on Android 14 relative to the performance that they saw on older versions of the OS (such as A12 or A13).
This is a known issue on Android Community and is note related to NXP implementation of AOSP (Android Open Source Project).
The information Android 14 can recollect from any debuggable application is a lot. With the help of Perfetto you can get and incredible analysis of all processes running on Android OS or an analysis of the memory usages. All this features have a side effect on debuggable applications, where debuggable application can experiment low performance. The degradation on the performance is around 1.5x and 2.0x the time taken on a previous Android version.
In order to take really measurements on the application performance it is necessary to disable those features when building the apk.
There are two ways of disabling debug features:
Build a release variant by adding a dummy key to Android-Studio. Read the following link to get further details on how to do it.
Set debuggable feature to false on build.gradle (Module :app). Here an example:
android {
buildTypes {
debug {
applicationIdSuffix '.debug'
debuggable false // The important line!
}
}
}Rebuild the apk and installed to the target with adb install <my-apk>. The application should now have the same performances it was having with A13 or older.