Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the skills of Android performance optimization

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

What are the knowledge points of this article "Android performance optimization skills?" most people do not understand, so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "Android performance optimization skills" article.

I. Pinner service configuration optimization

Modify / frameworks/base/core/res/res/values/config.xml

Add the following code:

... "/ system/framework/arm/boot-framework.art"/ system/lib/libjavacrypto.so"/ system/lib/libhidltransport.so"/ system/framework/arm/boot-core-libart.oat"/ system/framework/arm/boot-conscrypt.oat" / system/framework/arm/boot-core-libart.art "" / system/framework/arm/boot -ext.art "" / system/framework/arm/boot.art "" / system/framework/arm/boot-framework.art ". 2. Close WIFI Debugging

Modify frameworks/base/core/res/res/values/config.xml

False64 3. Turn off BT and automatic rotation by default

Modify frameworks/base/packages/SettingsProvider/res/values/defaults.xml

...... False false...... 4. The default value is 32 as the program

TARGET_ARCH and TARGET_ARCH_VARIANT are declared as 32-bit architectures, and do not declare

TARGET_2ND_ARCH or TARGET_2ND_ARCH_VARIANT

At the same time, configure zygote as 32-bit:

PRODUCT_DEFAULT_PROPERTY_OVERRIDES + = ro.zygote=zygote32 V, parameter adjustment of AMS part

Modify the code frameworks\ base\ services\ core\ java\ com\ android\ server\ am\ ActivityManagerConstants.java:

Adjust the default background maximum number of cache processes to 16:

Private static final int DEFAULT_MAX_CACHED_PROCESSES = SystemProperties.getInt ("ro....s.fw.bg_apps_limit", 16); VI. Frame rate optimization of screen output

First, make sure that the NUM_FRAMEBUFFER_SURFACE_BUFFERS value must be 3, and the SurfaceFlinger buffer size can be adjusted, for example:

Modify the file frameworks\ native\ services\ surfaceflinger\ Layer.cpp

Change mProducer- > setMaxDequeuedBufferCount (2) to mProducer- > setMaxDequeuedBufferCount (3) VII. Optimization scheme for low sliding frame rate

Modify the view config information under Framework. The code path is frameworks\ base\ core\ java\ android\ view\ ViewConfiguration.java.

The modification scheme is as follows:

Private static final int TOUCH_SLOP = 15 slop / set slop to 15private static final int MINIMUM_FLING_VELOCITY = 60; / / set to 60 8, file system optimization

For low memory devices, it is recommended to change the userdata partition format to f2fs format to reduce system overhead.

The modification scheme is as follows:

Device\ xxx\ xxxx_ Project\ BoardConfig.mk

TARGET_USERIMAGES_USE_F2FS: = trueBOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE: = f2fs IX. Disable the Dm_verity function

For low-memory devices, Google officially recommends turning off the dm_verity feature.

The shutdown method is as follows:

1. Modify device\ xxx\ xxxx_ project\ xxx_ project .mk

Turn off the dm_verity macro switch

PRODUCT_SUPPORTS_VERITY: = false / / set to the false2.kernel section

Remove dm_verity macro switch support.

CONFIG_DM_VERITY=y / / Delete this macro 3.system partition parameter modification

Remove the verify attribute from the parameter mounted in the corresponding system partition, for example:

/ dev/block/bootdevice/by-name/system / system ext4 ro,barrier=1 wait,verify / / remove the verify attribute

The mount of partitions is generally implemented in fstab.qcom.

The project of 8909go needs to delete the verify attribute in the corresponding partition in the dtsi file corresponding to kernel, and within the modified

The contents are as follows:

System {compatible = "android,system"; dev = "/ dev/block/platform/soc/7824900.sdhci/by-name/system"; type = "ext4"; mnt_flags = "ro,barrier=1"; fsmgr_flags = "wait"; status = "ok";}; 10. Optimize Touch boost functionality

For SmartPhone, you can enable Touch boost to improve the startup speed of the application. The enabling method is as follows:

Modify kernel/msm-4.4/drivers/cpufreq/cpu-boost.c code

The relevant variables are as follows:

/ sys/module/cpu_boost/parameters/input_boost_freq / sys/module/cpu_boost/parameters/input_boost_ms / sys/module/cpu_boost/parameters/sched_boost_on_input

The opening method is as follows:

1. The following is added to the kernel section: kernel config: CONFIG_CPU_BOOST=y defconfig file: kernel/msm-4.4/arch/arm64/configs/xxx_defconfig2.init.rc: echo 0v1747200 1VOV 1747200 2VOV 1747200 3RV 1747200 4Rd 1747200 5Rd 1747200 6RV 1747200 7RV 1747200 > / sys/module/cpu_boost/parameters/input_boost_freq

The above is about the content of this article on "what are the skills of Android performance optimization". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report