[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] very slow pygame.init() under Snow Leopard
- To: <pygame-users@xxxxxxxx>
- Subject: Re: [pygame] very slow pygame.init() under Snow Leopard
- From: John Jameson <jwing45@xxxxxxxxx>
- Date: Fri, 26 Aug 2011 10:32:53 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 26 Aug 2011 13:33:09 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=k0olYw77+4bwCZcpTF1RdGpp1+IKiBpj20ZaP9r1W4E=; b=QchtXOE0NOp56AlnekQmOfAZAykeZf7KUL2sA+V6vfFT3CQ2ladRpy3FcRTr6F8d0f cSEbyZby82SZARYnNAvuRnWx2bjNP+sM9n7j0z8KYNT5i/bX1uEQLHoX9RTtjXa4FdyK JCKG3Sl+2fAIf4g6EBxDAjGEVntzg8ssGy6ZM=
- In-reply-to: <4E57D26C.3000102@xxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- Thread-topic: [pygame] very slow pygame.init() under Snow Leopard
- User-agent: Microsoft-MacOutlook/14.12.0.110505
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
>>
>>
>