module imports and memory usage

2004-11-30 Thread Brad Tilley
When memory usage is a concern, is it better to do: from X import Y or import X Also, is there a way to load and unload modules as they are needed. I have some scripts that sleep for extended periods during a while loop and I need to be as memory friendly as possible. I can post a detailed scrip

Re: module imports and memory usage

2004-11-30 Thread Istvan Albert
Brad Tilley wrote: Also, is there a way to load and unload modules as they are needed. I have some scripts that sleep for extended periods during a while loop and I need to be as memory friendly as possible. I can post a detailed script that currently uses ~ 10MB of memory if anyone is interest

Re: module imports and memory usage

2004-11-30 Thread Jp Calderone
On Tue, 30 Nov 2004 10:02:27 -0500, Brad Tilley <[EMAIL PROTECTED]> wrote: >When memory usage is a concern, is it better to do: > > from X import Y > > or > > import X There is no difference. If you are concerned about memory usage, you probably need to take a look at the data structures ho

Re: module imports and memory usage

2004-11-30 Thread Brad Tilley
Jp Calderone wrote: On Tue, 30 Nov 2004 10:02:27 -0500, Brad Tilley <[EMAIL PROTECTED]> wrote: When memory usage is a concern, is it better to do: from X import Y or import X There is no difference. If you are concerned about memory usage, you probably need to take a look at the data structure

Re: module imports and memory usage

2004-11-30 Thread David Bolen
Brad Tilley <[EMAIL PROTECTED]> writes: > When memory usage is a concern, is it better to do: > > from X import Y > > or > > import X Depending on "Y", the latter can technically use less memory, but it's likely to be fairly small and depends on how many symbols from that module you want to ha

Re: module imports and memory usage

2004-11-30 Thread Brad Tilley
Brad Tilley wrote: When memory usage is a concern, is it better to do: from X import Y or import X Also, is there a way to load and unload modules as they are needed. I have some scripts that sleep for extended periods during a while loop and I need to be as memory friendly as possible. I can pos

Re: module imports and memory usage

2004-12-01 Thread Carlos Ribeiro
On Tue, 30 Nov 2004 16:46:43 -0500, Brad Tilley <[EMAIL PROTECTED]> wrote: > I discovered that when I wrap my code up in a function def and call it > that it uses around 4.6 MB of RAM all the time... even while sleeping. > However, when I don't put it in a function def it uses around 2.6MB of > dat