How to make your app more lightweight?

Source: Internet
Author: User
Tags microsoft outlook

Some of the smaller users of the hard drives, or the smaller users of the iphone, may often complain that the phone app or the installed application is too big for the device to run out of space. In particular, why Microsoft Outlook to 1G installation package, and Foxmai as long as 60M, why the same competing products app some 160M mobile phone space, some only for 5M? And when the user space is not enough, if your app is on the top of the footprint list, then your mobile app becomes the user's preferred target to delete.

Here's a quick explanation of why some mobile apps or apps are always taking up space:

1. Historical reasons

In order to be compatible with old versions or some old user habits, there may be some old features included in it, but sometimes the project development cycle may be short, and the programmer's brother will not move the old things, because once the code is involved, the cost is very high. Casually remove a function point, you need to consider the entire business process logic is fluent and complete, after the change will need QA again regression test, the process is like from a whole building inside to remove some bricks, carelessly there is the risk of sudden collapse.

2. In order to adapt to different user groups

For example, such as Office light installation package is more than 1G, installed after the completion of the installation of a variety of components have been installed for you, including what PPT Ah, Visio ah a variety of messy components, Excel even contains a VBScript such developers to use the components; Normal class only want to use a document or Excel features, Office will give you a lot of things installed.

3. The pursuit of cool, tall

Some apps use more highly accurate resources (images, audio, video) to make you look like a cow x, but these resource images take up the bulk of the app's capacity to get a kick out of the hot-blast-sky interface effect. In fact, the binary file of the program after compiling, the symbol file removed after the implementation of the document itself is very small, more than a few m, less hundreds of K

4. Third-party libraries

Some developers for the sake of the plan, will directly use some open source framework, such as playing games need to use cocos2d, Unity3d, etc., the application may use the REACTJS, etc., the advantage is a direct set of code across the platform, save the development time, enhance the development efficiency, But these third-party libraries are very large in themselves, because they don't know what you're going to use, they just give you everything.

5. User Data

When users use these mobile apps, there's a lot of use marks, some mobile apps (apps) simply run out and throw them away, like creating log files or temporary configuration files or some data records, just as annoying as people who throw rubbish. , there is no moral integrity to speak of.

Read all these, as a pm/rd will certainly have a variety of reasons: my project cycle tense ah, my programmer brother does not dump me ah, occupy the size of the space as long as not affect the function on the line AH 、、、, but ... These can not be reasonably illegal to occupy a large number of users use space reasons, how to make their own app more brisk, more useful, this is our ultimate goal. The product function again Ox X, the detail is not in place is in vain; here are my own suggestions for the above issues:

1. Decoupling your program: Now everyone is using the object-oriented language, if your program's classes can't be split into one of the simplest functions, or classes that rely on too many classes, it's definitely problematic, and you need a programmer to think about how to expand, how to write the underlying module, how to write the business module before you write the code, Which functions make a separate module, each class in the module is responsible for minimizing what decoupling function, it is best to split the tool class, the tool class may be divided into business tools and generic tool classes, might be used in future projects.

A chrome-like plug-in model is always the most classic architecture for client programs. Recommended nothing more to see "design mode", although you may feel outdated, no matter how the times change, some basic ideas will never change.

2. Dynamic loading required by the library: If you do a little bit, the 2nd is very good to solve, because all the modules are Hot plug mode, according to the needs of users to some of the unnecessary function of the module deleted, to keep occupy space to minimize.

3. As much as possible to use the drawing library: Now the drawing library is very cow x, all kinds of algorithms are written to you, and optimization is very good, as long as the use of good, do not use some pictures to solve the problem, often with pictures to solve the problem of the programmer is very lazy, lazy to understand the use of the drawing library, as long as a little more understanding of your drawing library , basically seconds kill a variety of special effects.

4. Reduce Third-party libraries: Many Third-party libraries contain many features that are not available. Get rid of all these features, and it's OK to use them any day, and if you don't cut the evidence that you don't know your production environment, it's scary; move up and get to know your bottom.

5. As much as possible to automatically upload some important user data to the cloud: such as some recent chat records, chat records in some picture files, etc., it is best to save the ID number uploaded to the Business Server, the picture is also used to save the bed can be. There are also some users of the use of preferences and other information to be saved to the cloud, local can leave a little bit of data; I have a friend of the two days before the circle of friends to say that they have a letter all chat information is gone, do not know what happened, the results of a variety of the day finally do a good job, but the loss of time and communication costs are immeasurable, It can be seen that such extreme anomalies, if handled well, bring value far more than the cost of doing these optimizations.

Finally, the PM in the daily development process also need to take these details as a whole project needs to seriously landing, because only like this can be polished the real boutique.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.