[Pythonmac-SIG] Slow python initialization

Bob Ippolito bob at redivi.com
Tue Dec 13 22:13:08 CET 2005


On Dec 13, 2005, at 1:01 PM, Bill Spotz wrote:

> 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.)

You could find out exactly what dir entries it's looking at with ktrace.

This might help:
http://bob.pythonmac.org/archives/2005/02/04/advanced-debugging- 
techniques-ktrace/

I'm guessing either you have some GIGANTIC directories, bad sectors  
on the disk, or that it's doing getdirentries on some remote  
filesystem.. AFP, NFS, WebDAV (or .mac) maybe?

-bob



More information about the Pythonmac-SIG mailing list