• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSHost currentHost Slow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSHost currentHost Slow


  • Subject: Re: NSHost currentHost Slow
  • From: j o a r <email@hidden>
  • Date: Tue, 4 Jan 2005 09:08:52 +0100


On 2005-01-04, at 07.23, John Tsombakos wrote:

I'm trying to track down this problem. It started with Safari taking a long time connecting to websites. (I enter a URL, hit return and the status line says "Connecting to...." for several seconds - up to almost a minute in some cases). (This is OS X 10.3.7, btw)

This was recently discussed in a thread named "[NSHost currenthost] slooooooooooow" by Henk Kampman. Some people see this problem, others don't. It has to be related to your network configuration in one way or another.


Mac OS X 10.3.5 - 10.3.6 had bug where DNS lookups would time out too quickly and return a failure to resolve the requested hostname. This bug was fixed in 10.3.7, and the fix is without a doubt linked to the appearance of this problem.

[h release];

Don't do this - h is an autoreleased object. This is a bug, and it will affect your results.


Here are my sample times.. you can see the first call takes upwards of 10 seconds:

[farside:~/Devel] john% ./a.out
2005-01-04 01:14:29.286 a.out[542] Time elapsed: 5.073724
2005-01-04 01:14:29.287 a.out[542] Time elapsed: 0.000212
[farside:~/Devel] john% ./a.out
2005-01-04 01:14:37.750 a.out[543] Time elapsed: 8.439076
2005-01-04 01:14:37.751 a.out[543] Time elapsed: 0.000215
[farside:~/Devel] john% ./a.out
2005-01-04 01:14:42.839 a.out[544] Time elapsed: 5.063639
2005-01-04 01:14:42.839 a.out[544] Time elapsed: 0.000208
[farside:~/Devel] john% ./a.out
2005-01-04 01:14:52.952 a.out[545] Time elapsed: 10.088655
2005-01-04 01:14:52.953 a.out[545] Time elapsed: 0.000213

My results typically looks like this:

2005-01-04 08:56:48.880 NSHostTest[1508] Time elapsed: 0.010992
2005-01-04 08:56:48.882 NSHostTest[1508] Time elapsed: 0.000022

This may be a bit off topic, but since it's NSHost that seems to be the problem, I figured I'd post my findings.

What if you print this:

	NSLog(@"%@\nTime elapsed: %f", h, [end timeIntervalSinceDate:start]);

My host looks something like this:

{type = mutable-small, count = 5, values = (
0 : <CFString 0x3075f0 [0xa01900e0]>{contents = "fe80::203:93ff:feec:2a93"}
1 : <CFString 0x307620 [0xa01900e0]>{contents = "10.0.1.20"}
2 : <CFString 0x3012e0 [0xa01900e0]>{contents = "::1"}
3 : <CFString 0x307540 [0xa01900e0]>{contents = "fe80::1"}
4 : <CFString 0x307590 [0xa01900e0]>{contents = "127.0.0.1"}
)}
<CFArray 0x300b50 [0xa01900e0]>{type = mutable-small, count = 2, values = (
0 : <CFString 0x3074c0 [0xa01900e0]>{contents = "imac.MyDomain.com"}
1 : <CFString 0x3074e0 [0xa01900e0]>{contents = "localhost"}
)}


j o a r

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSHost currentHost Slow
      • From: John Tsombakos <email@hidden>
References: 
 >NSHost currentHost Slow (From: John Tsombakos <email@hidden>)

  • Prev by Date: [Q]How can I bring the information of the file that I select from desktop to a program that I intend to make?
  • Next by Date: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
  • Previous by thread: NSHost currentHost Slow
  • Next by thread: Re: NSHost currentHost Slow
  • Index(es):
    • Date
    • Thread