Minimize the volume of ogremain. dll

Source: Internet
Author: User

 

We need to use ogre to develop Web3D games. The size of the files compiled from the latest version of ogre source code is about 9 MB. With some other dynamic libraries added, the basic dynamic libraries of nearly 20 MB are still available.

Such a large engine DLL is time-consuming for network transmission. Therefore, it is very important for Web3D to reduce the engine volume by some means.

Lightweight is always our goal.

The following are some methods for optimizing the volume:

1. You can ignore the boost Link Library, So that you cannot use the Ogre multi-thread function.

2. Do not use freeimage. This can be simplified. For example, you can delete most of the image formats that are not used. Only common formats such as BMP, PNG, and jpg are retained.

3. Do not use the ZIP file format. Use your own packaging tool.

4. to modify the source code of ogre in other methods, you can delete some source codes of ogre.

5. For compilation optimization, the minimum size is preferred, and debugging information is not generated.

Through these methods, I have reduced the ogre1.7.3 volume to 3.33 m, and then compressed it with ASPack. The DLL volume has been reduced to 774 M, and then compressed with the 7z limit to K. The engine volume can be controlled in 2 ~~ Below 4 MB, which is good for the Web3D application of ogre.

If you directly access ogremain around 9 m. DLL compression will reduce the volume to about 3 m (the ASPack compression rate is about 35%), but it will also occupy a lot of browser memory after being decompressed to the memory.

 

 

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.