Small micro-channel program development notes (optimization item)

Recently the company has a small program development project, and he taught himself a lot, there are some small experience developed, documented here.

Small program development Note:

1,setData

   Applets and logical views at two separate modules, does not have to transfer data directly, they are equivalent to the setData bridge. Common setData operation error of three.

     (1), frequently go setData: During the development process, as little as possible to setData, large amounts of data can lead to setData page Caton or pull-down delay and so on.

     (2), setData a number of new data: setData we know from the bottom of each setData will generate a script that led to the General Assembly the amount of data compiled script execution time is too long, taking up webView js thread.

     (3), states the background pages setData: there are no variables in wxml best not to use the setData, you can set a global change, the background page setData state will seize the front page of resources.

2 pictures

     The main performance issues Pictures of resources that are currently on the big picture and the long list of pictures, both of which are likely to lead to iOS client memory usage rises, triggering a small recovery system program page.

      

 

3, the code packet size optimization

     For small program code package size is 2018kb, for developers to pay attention to:

     (1), two or more pages to be packaged.

    (2), code and resources are not used must be promptly removed.

    (3), can be used instead of the font icon minimize the use of pictures.

 

Guess you like

Origin www.cnblogs.com/moxiaodegu/p/11757951.html