How to speed up the start speed of the applet?

zhaozj2021-02-08  286

Author: javaduke original in: www.dukejava.com

What shortcases and installation time

For the preface: Many friends complained that the applet is too slow, and its actual configuration, the reasonable application will be largely accepted the start time of Applet, this article is self-satisfied, and the summary is the following skills:

1, make the execution documents small

Although the Internet (TCP protocol) can be attached to the data stream of any length, but the network device (example: router) is responsible for the point-to-point transmission, the upper limit of the primary transmission packet is strict, and this limitation is 256. Therefore, when the small program is transmitted online, it is divided into a dry package on the upper limit it, and the last package can only be only a few bytes. These packages are single-oriented, and you need to have new components to the original minus. When the last package delay is late, you can use a few seconds to wait for the first few bytes to arrive. The only solution is to keep the class documents. Developers can try the following scenarios without affecting the logical subject: (1) Delete the error code; (2) Reduce String direct quantity; (3) Select the Java compiler to optimize the compilation option; (4) Delete Method, etc. Class scattered holds in the controlled range, there is no small program is made by a class. Tongmong, the developer is a high-level sub-program that is a strong manner, and has a stem class from the standard Java base class, and combines it. Therefore, if you want a small program, the Java virtual machine is to deliver and install these classes. If there are many more than the number of modern classes, the time to download is longer. We all know that downloading 20 independent data blocks take more time than downloading a big data block equivalent to 20 data blocks, which is because downloading each independent data block is re-connected, and It takes time to take time for each joint. Therefore, when the developer is set up, the number of classes should be selected, so that the structure can be guaranteed clear, but also to ensure that the programs are simple, and no redundancy is added. If there is a need to have a lot of classes, you will not pass the JAR packaging, and then shorten the download time, two to reduce the delay of the transaction server.

2, shortening of the short minor program initialization time Urioperi, etc., the initialization time should be shortened after the sequence is downloaded.

If the pre-treatment is more, it can be used to interact with each other with auxiliary thread, such as: ask questions, inquiry, name, display process, etc. Total, let the user "busy". At the same time, the small program main thread can continue to make initialization work in the background. If there is a sentence, please remember: "Gao Xing time is fast", and this present is the sensation of the time to replace the time. Another external network has a lot of existing small programs, allowing too much to be customized, which greatly increases the lattice start time, it is best to get the source code, customize, add fast. 3, try to shrink one with JAR

For a small program with graphics, sound, try to use JAR to compress, according to experience, can speed up start time. The above requires you to learn Java programming, it is impossible for the programming door, the webmaster is set up. A custom code provides a large number of demo special effects code, which provides free custom customization for each code, which is a small program that meets yourself, the loading speed is fast. It is important that no Java programming experience can quickly deploy Java special effects, No longer waiting, I am interested in and see.

转载请注明原文地址:https://www.9cbs.com/read-1732.html

New Post(0)