ANT compression (remove spaces/comments) JS files can improve js Running Speed _ extjs

Source: Internet
Author: User
There are many optimization methods to solve this problem. One of them today is to remove and merge spaces and comments in js during Ant script packaging, this has not yet been implemented. 1. It indicates that extjs is relatively slow to run, especially when there are too many running data and js data, or wait for a long time.
There are many optimization methods to solve this problem. One of them today is to remove and merge spaces and comments in js during Ant script packaging, this has not yet been implemented.
2. First, prepare two. jar files, YUIAnt. jar and yuicompressor-2.4.x.jar.
3. attachments to the two files

4. the build. xml file is as follows:

The Code is as follows:


























The Code is as follows:



















































5. Here, YUIAnt. jar does not support UTF-8 character sets when JavaScript compression is used. That is

The Code is as follows:


Encoding = "UTF-8



7. My personal feelings have been around for a long time. I thought it could improve the js loading speed. The result is still a little slow, not as fast as jquery, it is estimated that gzjs compression will speed up. Now I have analyzed that it is slower to run in IE, and faster in firefox. It seems that there are still a lot of js loaded in each module.
Comparison of optimization speed:

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.