[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



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" <len-l@xxxxxxxxx> 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 <corporalmustard@xxxxxxxxx
>> <mailto:corporalmustard@xxxxxxxxx>>
>> Reply-To: <pygame-users@xxxxxxxx <mailto:pygame-users@xxxxxxxx>>
>> Date: Fri, 26 Aug 2011 09:30:35 -0700
>> To: <pygame-users@xxxxxxxx <mailto:pygame-users@xxxxxxxx>>
>> 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 <jwing45@xxxxxxxxx
>> <mailto:jwing45@xxxxxxxxx>> 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
>>
>>
>