当前位置:网站首页>How to evaluate performance optimization? Covering too much knowledge?

How to evaluate performance optimization? Covering too much knowledge?

2022-06-23 21:05:00 Programmer Gu

Preface

With Android Development is becoming more and more standardized , The quality of domestic engineers , And users' requirements for products are becoming higher and higher .

This also indirectly leads to our demanding quality requirements for R & D projects , Memory optimization 、UI Carton optimization 、App Crash monitoring And other performance tuning has gradually become a necessary skill for people .

After work , It inevitably makes us feel that learning is endless , as well as Android Development is also bottomless .

Did performance related work , Also contacted many modules , To be honest, we should do a good job in performance , It's not easy . Why do you say that? ? Because there is too much knowledge to contact , Android It's a whole , Pull one hair and move the whole body , It doesn't mean that you can do well only by understanding one module

The following information is shared by technical predecessors Android Knowledge required for performance optimization , It covers all aspects related to performance optimization, including project practice

Project practice

  • Starting speed
  • Fluency
  • Vibrato in APK The practice of packet size resource optimization
  • Youku responsive layout technology full analysis
  • network optimization
  • Mobile phone Taobao double 11 performance optimization project revealed
  • Gao de APP Full link source code dependency analysis
  • Get rid of OOM Experience sharing in actual combat
  • WeChat Android Terminal memory optimization practice

theory

stay Android Application optimization , We mainly from the following 6 Optimize the following aspects :

  • Start up speed and execution efficiency optimization
  • Layout detection and optimization
  • Memory optimization
  • Power consumption optimization
  • Network transmission and data storage optimization
  • APK Size optimization

One 、 Start up speed and execution efficiency optimization

  • Analysis of cold start and hot start This section mainly introduces the starting mode 、 characteristic 、 Application start process 、 Measure the start time of the application 、 What is the startup time of an application 、 Reduce application startup time 、 Optimize the app launch experience .
  • APP Start the black and white screen solution resolvent 1, Change the background of the white screen to a picture ; resolvent 2, Make the background transparent .
  • APP The analysis and solution of Caton problem 16ms principle ; Caton handles ; Triple Buffer, Since frame loss is inevitable ,Android The team never gave up on this optimization , So there comes Triple Buffer( Three buffers ).
  • Start speed and execution efficiency optimization StrictMode StrictMode Detailed explanation 、Systrace and TraceView.

Two 、 Layout detection and optimization

  • Layout level optimization Every component of the program and Layout All need to be initialized 、 Layout and drawing , If the layout is nested too deep , This will make the load operation more time-consuming , If it is more serious, it may cause memory overflow . In this section, learn to use two tools to examine and optimize Layout.
  • Over rendering Now that you can know the number of over rendering through the system settings , Read the value when testing , Just fill in the report , Why automation ? Because it's right app When testing the system , You'll find a lot of pages , If housekeeper one or two levels of page on how big 20 Multiple , And integration package , Grayscale package , Official package , All regression packages are tested once , So it is necessary to do automatic over rendering count reading .

3、 ... and 、 Memory optimization

because Android Sandbox mechanism of application , There is a limit to the amount of memory allocated to each application , Too low memory triggers LMK(Low Memory Killer) Mechanism , And then there will be flashback . If you want to optimize memory , You need to understand java How is the memory allocated and reclaimed , About this , You can focus on the following content : Android Apply memory leak location 、 Analysis and solution strategy

It mainly includes

  • Memory jitters and memory leaks
  • Big memory ,Bitmap Memory optimization
  • Profile Memory monitoring tool
  • Mat Large objects and leak detection

Four 、 Power consumption optimization

If one app Rarely used , however app But the power consumption is very high , At this time, the user must want to directly uninstall this app. So how to lower yourself app That's a very important thing .

What are the factors of power consumption ?

(1)Alarm Manager wakeup Wake up too much (2) Frequent use of local wake-up locks (3) Background network usage is too high (4) backstage WiFi scans Too much

The details include

  • Doze&Standby
  • Battery Historian
  • JobScheduler、WorkManager

5、 ... and 、 Network transmission and data storage optimization

  • google Serialization tool protobuf
  • 7z Ultimate compression

6、 ... and 、APK Size optimization

Let's have apk File as small as possible , Remove unused code and resource files , Save downloads and improve efficiency .

  • APK Slimming
  • The principle of wechat resource confusion

summary

As someone who's been here , Know how hard it is to find information , So I have all the information ready for you , If you need a partner, please Click here to get it for free .

原网站

版权声明
本文为[Programmer Gu]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112261851068491.html