473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to make python24.dll smaller ?

Hello,

I am trying to make an executable for one of my applications with cx
freeze. All works ok although I must include python24.dll with it if I
want to redistribute it. The big problem is python24.dll size, it's 1.8
MB and I am sure I don't need much of what's in there.

I downloaded python source code and built the dll using the VC 7.1
project (directory PCBuild/), still can't figure out how I can tweak
the project so I get smaller dll - for example is there a way to find
out what modules are included, what is the approx size they take inside
the dll and how can I not include them by default ?

Thanks,
Andrei

Sep 14 '05 #1
2 2246
Ok, for anyone interested on the issue: I have found the solution. I
commented out some module lines inside config.c (modules I know for
certain I will not use) and removed the module .c files from the
project.

Biggest save was when I removed the Asian character encodings, reduced
size by about 650 KB.

I also changed the build options to link against multithreaded libs,
not multithreaded dll libs (which makes python24.dll dependent on
msvcr71.dll which in turn is not present on some people's computers and
would have to be distributed in that case).

Final result: a 1.1 MB python24.dll which works with my frozen apps and
is not dependent on msvcr71.dll and compressed goes to around 440 KB.
And I'm sure that depending on the project I still could trim some more
modules out.

Andrei

Sep 14 '05 #2
Stormbringer wrote:
Final result: a 1.1 MB python24.dll which works with my frozen apps and
is not dependent on msvcr71.dll and compressed goes to around 440 KB.
And I'm sure that depending on the project I still could trim some more
modules out.


If you are building yourself, anyway, I recommend an even more drastic
approach (which, alas, requires more work also): build a static library
for all the extension modules, and then use freeze to generate the
config.c. Linking it all together will bring in just those modules which
are actually referenced in config.c, and freeze will guess what modules
to put into config.c based on import statements. You might be able
to trim it further by explicitly excluding modules on the freeze command
line if you happen to know that some import statements are never
executed in your application (this is actually worthwhile for the
Python modules as well).

Regards,
Martin
Sep 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jose Rivera | last post by:
Hi I changed for python24 and the only thing missed is metakit for python24. Thanks
24
by: Robin Becker | last post by:
Investigating a query about the python path I see that my win32 installation has c:/windows/system32/python24.zip (which is non existent) second on sys.path before the actual python24/lib etc etc....
3
by: Robert | last post by:
updating a py2exe'd software I was impressed by python24.dll's footprint - double size of python23.dll Is there a version without/separate asianc codecs (which seem to mainly blow up...
1
by: Robert | last post by:
Martin v. Löwis schrieb: > Robert wrote: > > Wouldn't it be an issue to think about if future win-python distributions > > should keep on including the asian codecs in the main-dll? > > Indeed,...
12
by: a | last post by:
def fn(): for i in range(l) global count count= .... how do i declare count to be global if it is an array subsequently i should access or define count as an array error:
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
7
by: Jonathan Fine | last post by:
Hello My problem is that I want a Python 2.4 module on a server that is running Python 2.3. I definitely want to use the 2.4 module, and I don't want to require the server to move to Python...
9
by: korean_dave | last post by:
From command Prompt, i type in a script, "tryme.py". This, instead, brings up PythonWin editor and Interactive Window. Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) ...
5
by: zxo102 | last post by:
Hi, I am trying to use python module smtplib to send my email out on window xp (localhost). import smtplib server = smtplib.SMTP('localhost') but I got the error information as follows: ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.