Javascript tool-use packer to compress JS files

Source: Internet
Author: User

You can go to the siteHttp://dean.edwards.name/packer/Obtain the Web processing tool.

 

Packer is a javascript compression tool. Specifically, it compresses the variable name of the JS script and uses Base 64 for encoding and other processing to achieve the expected effect.

This section compares the processing of the same JS file in JS minifier and packer.

JS minifier result (maximum agressive processing level)

Original size: 103744; processed size: 54575; post-processed ratio: 52.6% (percentage of the original size, the smaller the better, the same below)

 

Packer result (no variable compression and base64 encoding)

Original size: 103744; processed size: 54248; ratio: 52.3%

Packer result (use variable compression and base64-Free Encoding)

Original size: 103744; processed size: 50797; ratio: 49.0%

Packer result (use variable compression and base64 encoding)

Original size: 103744; processed size: 31691; ratio: 30.5%

It seems that packer is better than JS minifier. But it is estimated that JS minifier is more famous. What tools do you Want to filter JS.

 

(Note: after testing, the JS file generated by packer cannot be run. It may be my Js compiling problem. When using packer, pay attention to the test. Maybe packer has a bug.)

 

 

Related Article

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.