[NSHost currentHost] slowness and Parallels
I was noticing that Mail.app and occasionally Safari would sometimes be really slow, particularly right after launch. In some cases, hitting 'reply' to a message would take almost a minute of waiting for the beachball to go away before I got a message window. It got so bad that I decided to fire up the debugger and see what was going on.
I'd get a backtrace that would look like this:
(gdb) bt
#0 0x90009cd7 in mach_msg_trap ()
#1 0x90009c38 in mach_msg ()
#2 0x90024b16 in _lookup_all_secure ()
#3 0x90024a08 in _lookup_all ()
#4 0x900574c0 in getnameinfo ()
#5 0x928892fb in +[NSHost currentHost] ()
So I decided to explore what [NSHost currentHost] does a bit more. It calls lookupd to get address info on all the active interfaces in the system, but sometimes it would take up to 60 seconds to return.
Long story short - I've got Parallels 3.0 installed. Disabling the Parallels Host-Guest network interface in Preferences made [NSHost currentHost] speed way up.
Labels: mac os cocoa slow


1 Comments:
Funny, I was just researching the same issue. Safari (3.0 beta) was hanging right at startup. I hooked up gdb and saw the same backtrace as you. I disabled my Parallels NAT and Parallels Host-Guest interfaces. Seems to be working fine now. I might just assign those interfaces static IPs and add them to my /etc/hosts file.
Post a Comment
Links to this post:
Create a Link
<< Home