Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread Lenard Lindstrom

On 26/08/11 12:04 PM, René Dudfield wrote:
On Fri, Aug 26, 2011 at 8:52 PM, Lenard Lindstrom > wrote:


Generally, yes. But the examples highlight specific modules. And
on Debian squeeze the alsa sound system keeps printing annoying
buffer underflow messages to the console when the mixer module is
initialized but not used.

Lenard


Ah, that's an annoying bug in SDL/alsa I guess.

Yeah, it's probably best to modify the examples to init the modules 
they need explicitly.  I can do this.


cheers,

Thanks. We can split the task if it makes things easier.

Lenard



Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread René Dudfield
On Fri, Aug 26, 2011 at 8:52 PM, Lenard Lindstrom  wrote:

> Generally, yes. But the examples highlight specific modules. And on Debian
> squeeze the alsa sound system keeps printing annoying buffer underflow
> messages to the console when the mixer module is initialized but not used.
>
> Lenard
>
>
Ah, that's an annoying bug in SDL/alsa I guess.

Yeah, it's probably best to modify the examples to init the modules they
need explicitly.  I can do this.

cheers,


Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread Lenard Lindstrom

On 26/08/11 11:32 AM, René Dudfield wrote:
On Fri, Aug 26, 2011 at 8:28 PM, Lenard Lindstrom > wrote:


Hi,

The "pygame.init('display', ...) is redundant. The exclude list
would be useful for omitting an unused, costly, module. But in
general I agree that calling init() only on those modules that are
used is good programming practice. The Pygame examples should even
be updated to reflect this. Using pygame.init() is much like "from
pygame import *".

Lenard


Updating the examples is a good idea.  There is something nice about 
just calling pygame.init() and being good to go however.


I'll also look at the documentation for pygame.init() to make sure it 
displays all of the modules.



cheers,
Generally, yes. But the examples highlight specific modules. And on 
Debian squeeze the alsa sound system keeps printing annoying buffer 
underflow messages to the console when the mixer module is initialized 
but not used.


Lenard



Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread Christopher Night
On Fri, Aug 26, 2011 at 2:28 PM, Lenard Lindstrom  wrote:

> The "pygame.init('display', ...) is redundant. The exclude list would be
> useful for omitting an unused, costly, module. But in general I agree that
> calling init() only on those modules that are used is good programming
> practice. The Pygame examples should even be updated to reflect this. Using
> pygame.init() is much like "from pygame import *".


I see in the documentation that someone left a comment saying that not
calling pygame.init prevents you from using pygame.time.get_ticks. Is there
a workaround for people who want to use this function but don't want to call
pygame.init? I'm also curious how it might work with lazy imports (which
sounds like a great idea).

-Christopher


Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread René Dudfield
On Fri, Aug 26, 2011 at 8:28 PM, Lenard Lindstrom  wrote:

> Hi,
>
> The "pygame.init('display', ...) is redundant. The exclude list would be
> useful for omitting an unused, costly, module. But in general I agree that
> calling init() only on those modules that are used is good programming
> practice. The Pygame examples should even be updated to reflect this. Using
> pygame.init() is much like "from pygame import *".
>
> Lenard
>
>
Updating the examples is a good idea.  There is something nice about just
calling pygame.init() and being good to go however.

I'll also look at the documentation for pygame.init() to make sure it
displays all of the modules.


cheers,


Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread Lenard Lindstrom

On 26/08/11 11:15 AM, René Dudfield wrote:



On Fri, Aug 26, 2011 at 8:10 PM, Lenard Lindstrom > wrote:


An exclude list for pygame.init() :

pygame.init(exclude=['movie', ])

That is feasible. And with no keyword argument:

pygame.init('display', 'mixer', ...)

only those modules are initialized.

pygame.init()

would continue to initialize everything. If this looks good I will
add it to the wish list.

Lenard Lindstrom



Hi,

I think it's a good idea, except I don't see how it's much better than...

pygame.display.init()
pygame.mixer.init()

Which would be backwards compatible with older pygames.

Hi,

The "pygame.init('display', ...) is redundant. The exclude list would be 
useful for omitting an unused, costly, module. But in general I agree 
that calling init() only on those modules that are used is good 
programming practice. The Pygame examples should even be updated to 
reflect this. Using pygame.init() is much like "from pygame import *".


Lenard



Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread René Dudfield
On Fri, Aug 26, 2011 at 8:10 PM, Lenard Lindstrom  wrote:

> An exclude list for pygame.init() :
>
> pygame.init(exclude=['movie', ])
>
> That is feasible. And with no keyword argument:
>
> pygame.init('display', 'mixer', ...)
>
> only those modules are initialized.
>
> pygame.init()
>
> would continue to initialize everything. If this looks good I will add it
> to the wish list.
>
> Lenard Lindstrom
>
>
>
Hi,

I think it's a good idea, except I don't see how it's much better than...

pygame.display.init()
pygame.mixer.init()

Which would be backwards compatible with older pygames.


Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread Lenard Lindstrom

An exclude list for pygame.init() :

pygame.init(exclude=['movie', ])

That is feasible. And with no keyword argument:

pygame.init('display', 'mixer', ...)

only those modules are initialized.

pygame.init()

would continue to initialize everything. If this looks good I will add 
it to the wish list.


Lenard Lindstrom

On 26/08/11 10:32 AM, John Jameson wrote:

Actually, come to think of it I meant to say (with tongue in cheek)

"pygame.init_all_but(XXX)"

not
 "from pygame import all but xxx"

but what you are suggesting is probably a good idea too (I guess, I'm just
starting with pygame).





On 8/26/11 10:05 AM, "Lenard Lindstrom"  wrote:


Hi John,

I have experimented with lazy importing of Pygame modules. Modules are
only loaded when directly accessed. It does decrease Pygame startup
time. I am considering adding it to Pygame 1.9.2. If there is interest I
can make it a priority. The main roadblock was making lazy imports
optional. I think I have solved that.

Lenard Lindstrom

On 26/08/11 09:46 AM, John Jameson wrote:

Yes, thanks, this did help on one little program so far. If I knew
which package(s) were really slow at loading then it'd be great if
there were a python command  like  "from pygame import all but xxx"  ;-)








Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread John Jameson
Actually, come to think of it I meant to say (with tongue in cheek)

"pygame.init_all_but(XXX)"

not
 "from pygame import all but xxx"

but what you are suggesting is probably a good idea too (I guess, I'm just
starting with pygame).





On 8/26/11 10:05 AM, "Lenard Lindstrom"  wrote:

>Hi John,
>
>I have experimented with lazy importing of Pygame modules. Modules are
>only loaded when directly accessed. It does decrease Pygame startup
>time. I am considering adding it to Pygame 1.9.2. If there is interest I
>can make it a priority. The main roadblock was making lazy imports
>optional. I think I have solved that.
>
>Lenard Lindstrom
>
>On 26/08/11 09:46 AM, John Jameson wrote:
>> Yes, thanks, this did help on one little program so far. If I knew
>> which package(s) were really slow at loading then it'd be great if
>> there were a python command  like  "from pygame import all but xxx"  ;-)
>>
>>
>>
>>
>> From: Jack Anderson > <mailto:corporalmust...@gmail.com>>
>> Reply-To: mailto:pygame-users@seul.org>>
>> Date: Fri, 26 Aug 2011 09:30:35 -0700
>> To: mailto:pygame-users@seul.org>>
>> Subject: Re: [pygame] very slow pygame.init() under Snow Leopard
>>
>> Init() from my understanding is just a shortcut to call all of the
>> initialization functions on the main pygame packages, it is likely a
>> specific pygame package which is causing the slowdown, try calling the
>> init() functions on only the packages you need, i.e. display, mixer,
>> etc.  And see if that helps.  At the very least, we'll have a better
>> idea of which packages are causing slowdown.
>>
>> On Fri, Aug 26, 2011 at 8:58 AM, John Jameson > <mailto:jwin...@gmail.com>> wrote:
>>
>> I have a new Macbook Pro running 10.6 Snow Leopard and when I run
>> any pygame code that calls pygame.init() it takes literally about
>> 10 seconds to complete the call. Other examples, like "Samegame"
>> are quite elaborate but don't call init() and start up
>> immediately. Any thoughts anyone?  I installed python 2.6 via
>> Macports (64bit) with Pygame 1.9.
>> best,
>> John
>>
>>
>




Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread Lenard Lindstrom

Hi John,

I have experimented with lazy importing of Pygame modules. Modules are 
only loaded when directly accessed. It does decrease Pygame startup 
time. I am considering adding it to Pygame 1.9.2. If there is interest I 
can make it a priority. The main roadblock was making lazy imports 
optional. I think I have solved that.


Lenard Lindstrom

On 26/08/11 09:46 AM, John Jameson wrote:
Yes, thanks, this did help on one little program so far. If I knew 
which package(s) were really slow at loading then it'd be great if 
there were a python command  like  "from pygame import all but xxx"  ;-)





From: Jack Anderson <mailto:corporalmust...@gmail.com>>

Reply-To: mailto:pygame-users@seul.org>>
Date: Fri, 26 Aug 2011 09:30:35 -0700
To: mailto:pygame-users@seul.org>>
Subject: Re: [pygame] very slow pygame.init() under Snow Leopard

Init() from my understanding is just a shortcut to call all of the 
initialization functions on the main pygame packages, it is likely a 
specific pygame package which is causing the slowdown, try calling the 
init() functions on only the packages you need, i.e. display, mixer, 
etc.  And see if that helps.  At the very least, we'll have a better 
idea of which packages are causing slowdown.


On Fri, Aug 26, 2011 at 8:58 AM, John Jameson <mailto:jwin...@gmail.com>> wrote:


I have a new Macbook Pro running 10.6 Snow Leopard and when I run
any pygame code that calls pygame.init() it takes literally about
10 seconds to complete the call. Other examples, like "Samegame"
are quite elaborate but don't call init() and start up
immediately. Any thoughts anyone?  I installed python 2.6 via
Macports (64bit) with Pygame 1.9.
best,
John






Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread John Jameson
Yes, thanks, this did help on one little program so far. If I knew which
package(s) were really slow at loading then it'd be great if there were a
python command  like  "from pygame import all but xxx"  ;-)




From:  Jack Anderson 
Reply-To:  
Date:  Fri, 26 Aug 2011 09:30:35 -0700
To:  
Subject:  Re: [pygame] very slow pygame.init() under Snow Leopard

Init() from my understanding is just a shortcut to call all of the
initialization functions on the main pygame packages, it is likely a
specific pygame package which is causing the slowdown, try calling the
init() functions on only the packages you need, i.e. display, mixer, etc.
And see if that helps.  At the very least, we'll have a better idea of which
packages are causing slowdown.

On Fri, Aug 26, 2011 at 8:58 AM, John Jameson  wrote:
> I have a new Macbook Pro running 10.6 Snow Leopard and when I run any pygame
> code that calls pygame.init() it takes literally about 10 seconds to complete
> the call. Other examples, like "Samegame" are quite elaborate but don't call
> init() and start up immediately. Any thoughts anyone?  I installed python 2.6
> via Macports (64bit) with Pygame 1.9.
> best,
> John





Re: [pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread Jack Anderson
Init() from my understanding is just a shortcut to call all of the
initialization functions on the main pygame packages, it is likely a
specific pygame package which is causing the slowdown, try calling the
init() functions on only the packages you need, i.e. display, mixer, etc.
And see if that helps.  At the very least, we'll have a better idea of which
packages are causing slowdown.

On Fri, Aug 26, 2011 at 8:58 AM, John Jameson  wrote:

> I have a new Macbook Pro running 10.6 Snow Leopard and when I run any
> pygame code that calls pygame.init() it takes literally about 10 seconds to
> complete the call. Other examples, like "Samegame" are quite elaborate but
> don't call init() and start up immediately. Any thoughts anyone?  I
> installed python 2.6 via Macports (64bit) with Pygame 1.9.
> best,
> John
>


[pygame] very slow pygame.init() under Snow Leopard

2011-08-26 Thread John Jameson
I have a new Macbook Pro running 10.6 Snow Leopard and when I run any pygame
code that calls pygame.init() it takes literally about 10 seconds to
complete the call. Other examples, like "Samegame" are quite elaborate but
don't call init() and start up immediately. Any thoughts anyone?  I
installed python 2.6 via Macports (64bit) with Pygame 1.9.
best,
John