[Pythonmac-SIG] Slow python initialization

Bill Spotz wfspotz at sandia.gov
Tue Dec 13 22:01:45 CET 2005


OK, I seem to be converging on something here, but I don't know what  
to do with it.  Shark gives me the following tree:

	97.6%	97.6%	mach_kernel	memcmp	
	0.0%	94.3%	mach_kernel	vfs_addname	
	0.0%	94.3%	mach_kernel	hfs_create_attr_btree	
	0.0%	94.3%	mach_kernel	BTIterateRecords	
	0.0%	94.3%	mach_kernel	hfs_create_attr_btree	
	0.0%	94.3%	mach_kernel	MacToVFSError	
	0.0%	94.3%	mach_kernel	VNOP_READDIR	
	0.0%	94.3%	mach_kernel	getdirentries	
	0.0%	94.3%	mach_kernel	unix_syscall	
	0.0%	94.3%	mach_kernel	shandler	

and under gdb when I break, python is in getdirentries().  (This  
could also indicate my problem with the bash tab-completion.)

On Dec 13, 2005, at 11:03 AM, Bob Ippolito wrote:

> On Dec 13, 2005, at 9:38 AM, Bill Spotz wrote:
>
>> I recently upgraded my dual-processor G5 from Mac OS X 10.3 to 10.4.
>> Ever since, the python initialization has been extremely slow, maybe
>> 10 seconds or so between issuing the "python" command and getting a
>> prompt.  I run some automated tests on this machine, and the delays
>> can add up, dwarfing the actual execution time.
>>
>> The problem persists whether I:
>>      * Run python 2.4.2 (/sw/bin/python, compiled w/GCC 4.0.0) or
>> 2.3.5 (/usr/bin/python, compiled w/GCC 3.3)
>>      * Run with or without a PYTHONSTARTUP file
>>      * Run under bash 3.00.0(1) (/sw/bin/bash) or 2.05b.0(1) (/bin/ 
>> bash)
>>
>> Has anyone else seen this behavior?  Or have a solution?  (Similarly,
>> although less related to this mailing list, when I try to use tab-
>> completion under bash, I get a long delay as well.)
>
> No, but I would profile it with Shark to see where it's spending  
> time.  Or even just run it under gdb and break when it's stalling..  
> I'm guessing it's waiting on some kind of resource.
>
> -bob

** Bill Spotz                                              **
** Sandia National Laboratories  Voice: (505)845-0170      **
** P.O. Box 5800                 Fax:   (505)284-5451      **
** Albuquerque, NM 87185-0316    Email: wfspotz at sandia.gov **





More information about the Pythonmac-SIG mailing list