Size of distribution

Srekel

04-01-2007 22:22:40

I just checked how big the folder containing the dlls, exe etc of the Avalanche demo I did last week, using Python-Ogre 0.65 (I think), using a standard py2exe method, and it's 31mb!

Here's the exact directory listing:


F:\public\Projects\AvalancheDemo\bin>dir /OS
Volume in drive F is Pajformen
Volume Serial Number is 5426-BE95

Directory of F:\public\Projects\AvalancheDemo\bin

2006-12-21 16:35 <DIR> ..
2006-12-21 16:35 <DIR> .
2006-10-16 21:11 87 quake3settings.cfg
2006-12-21 16:24 324 plugins.cfg
2006-10-16 21:11 381 media.cfg
2006-05-28 01:34 391 res.cfg
2006-12-21 23:14 403 ogre.cfg
2006-11-18 22:06 1 082 resources.cfg
2006-10-16 21:11 2 348 terrain.cfg
2006-09-19 09:52 4 608 w9xpopen.exe
2006-12-21 23:16 11 457 Ogre.log
2006-12-21 16:22 20 992 demo.exe
2003-11-18 00:29 55 808 zlib1.dll
2006-11-20 07:38 65 536 ReferenceAppLayer.dll
2005-11-09 00:25 73 728 ILU.dll
2006-09-19 09:52 77 824 bz2.pyd
2006-09-28 17:23 81 920 OIS.dll
2006-11-20 07:37 98 304 Plugin_ParticleFX.dll
2004-08-04 00:56 181 760 DINPUT8.dll
2006-10-28 13:05 258 048 boost_python.dll
2006-11-20 07:39 331 776 RenderSystem_Direct3D9.dll
2006-03-16 15:19 348 160 MSVCR71.dll
2006-11-17 07:59 409 600 ode.dll
2006-05-24 21:32 446 464 Newton.dll
2006-11-16 18:54 462 848 _ogrerefapp_.pyd
2006-09-19 09:52 475 136 unicodedata.pyd
2006-11-20 07:41 487 424 RenderSystem_GL.dll
2006-12-21 16:22 741 806 library.zip
2005-11-09 00:30 761 856 DevIL.dll
2006-10-28 13:10 790 528 _ois_.pyd
2006-07-16 22:52 1 073 152 FreeImage.dll
2006-11-26 18:57 1 150 976 _ogrenewt_.pyd
2006-09-19 09:52 2 109 440 python25.dll
2006-03-31 12:40 2 388 176 d3dx9_30.dll
2006-11-20 07:36 3 111 936 OgreMain.dll
2006-11-23 16:56 16 711 680 _ogre_.pyd
34 File(s) 32 735 959 bytes
2 Dir(s) 3 353 853 952 bytes free



I then compared it to A Violent World, which is a lot smaller (still quite big though):



C:\Games\A Violent World\dlls>dir /OS
Volume in drive C is Kakburken
Volume Serial Number is 54FB-D125

Directory of C:\Games\A Violent World\dlls

2006-11-18 00:05 <DIR> ..
2006-11-18 00:05 <DIR> .
2006-11-18 00:03 196 ogre.cfg
2006-11-18 00:13 482 highscores.dat
2004-11-30 11:49 4 608 w9xpopen.exe
2005-10-24 22:05 16 384 ilut.dll
2005-11-01 04:10 20 992 GameApplication.exe
2005-10-24 22:05 26 112 Plugin_CgProgramManager.dll
2002-07-19 17:06 27 648 ilu.dll
2005-10-24 22:05 49 152 OgreGUIRenderer.dll
2006-11-18 00:15 53 185 Ogre.log
2003-11-18 02:29 55 808 zlib1.dll
2004-11-30 11:49 65 536 zlib.pyd
2004-11-30 11:49 77 824 bz2.pyd
2005-10-24 22:05 86 528 Plugin_ParticleFX.dll
2005-10-24 22:05 126 976 Plugin_BSPSceneManager.dll
2005-10-26 22:40 161 280 fmod.dll
2005-10-24 22:05 180 224 Plugin_OctreeSceneManager.dll
2005-10-30 22:35 196 608 _psyco.pyd
2005-10-24 22:05 237 568 RenderSystem_Direct3D7.dll
2002-07-19 17:05 269 312 devil.dll
2005-02-12 14:20 303 104 pySonic.pyd
2005-03-28 10:48 315 392 _imaging.pyd
2005-10-24 22:05 344 064 ReferenceAppLayer.dll
2003-02-21 04:42 348 160 MSVCR71.dll
2005-10-24 22:05 364 544 OgrePlatform.dll
2004-11-30 11:49 405 504 unicodedata.pyd
2005-10-24 22:05 421 888 RenderSystem_GL.dll
2005-10-24 22:05 1 171 456 RenderSystem_Direct3D9.dll
2005-10-24 22:05 1 388 544 cg.dll
2004-11-30 11:49 1 867 776 python24.dll
2005-10-24 22:05 1 916 928 xerces-c_2_5_0.dll
2005-10-07 13:47 2 106 880 OgreMain.dll
2005-11-01 04:10 2 581 118 library.zip
2005-10-24 01:50 3 477 504 _ogre.pyd
33 File(s) 18 669 285 bytes
2 Dir(s) 2 538 233 856 bytes free



As you can see, the *.pyd fil is a lot smaller using PyOgre instead of Python-Ogre. Is there any reason for this? Is it possible to make it smaller somehow? Are there any other tricks one can use when py2exe-ing to perhaps remove unnecessary dlls, or make some files smaller?

griminventions

05-01-2007 01:55:04

You could try using UPX to compress the dlls. I've read that some antivirus tools have in the past flagged it as a virus due to the nature of how it works, but that may not be a concern anymore if it's been cleared as legit with those tools. It has pretty good compression ratios, often 50% or more in my unscientific experience with it.

Ideally, though, it would be nice to eliminate as many dlls as possible and reduce the size of the main ogre dll. 31mb is pretty huge for a baseline install.

andy

05-01-2007 03:54:19

Can I suggest that you don't worry too much about this at the moment :)

The base Python-Ogre dll's are currently about 30% bigger than they 'should' be because I don't have full optimisation enabled in the linker -- and the reason for this is that having a link time of 3-4 minutes is better than 60-70 minutes :)

Also the Python-Ogre distribution will always be bigger than the old pyogre as we are wrapping 'everything', and enabling overrides/subclassing (python style) of just about everything in the Ogre library.. Plus the documentation (pydoc strings) is part of the dll's...

Cheers
Andy

Martins1

14-01-2007 15:40:00

I tried compressing with Upx, and
my 15Mb ogre.pyd and it shrinked to incredible 2Mb!


Ultimate Packer for eXecutables
Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006
UPX 2.03w Markus Oberhumer, Laszlo Molnar & John Reiser Nov 7th 2006

File size Ratio Format Name
-------------------- ------ ----------- -----------
15392768 -> 2053120 13.34% win32/pe _ogre_.pyd

Packed 1 file.

Keeyai

29-01-2007 00:17:48

15mb to 2mb is awesome. Thanks for the link; I'll check out UPX and hopefully have some results to share as well.

Game_Ender

29-01-2007 05:06:20

Just so everyone is on the same page, UPX will not change the fact that the Python-Ogre dll's will take up more room in memory that the PyOgre ones. It will just decrease size on disk.