• 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: Does CFSocket use efficient polling?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does CFSocket use efficient polling?


  • Subject: Re: Does CFSocket use efficient polling?
  • From: Jeremy Wyld <email@hidden>
  • Date: Fri, 13 Feb 2009 16:41:49 -0800

On Feb 13, 2009, at 4:35 PM, Mark Pauley wrote:

Did you sample test #1 to see where the time is spent? Repeated appends to an NSMutableData will do a lot of memcpy's as it grows its buffer, with performance roughly O(n^2).

If that's the case, you may be able to pre-initialize your NSMutableData with the value of the Content-Length header field (when present) in -didRecieveResponse:


http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableData_Class/Reference/NSMutableData.html#/ /apple_ref/occ/instm/NSMutableData/initWithCapacity:

Unless it's super huge! That does very bad things on the Phone.

Also the speed tests aren't great. Using a 50MB file on a giga link is really showing burst speeds. That number is important, and in this case, he was trying to show CPU usage. Larger downloads should be used for throughput comparisons.

Mark, also, was good to point out comparing NSURLConnection is not the best comparison as it has yet another layer over CFStream which is a layer over CFSocket which was being questioned in the first place.

jeremy

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


  • Follow-Ups:
    • Re: Does CFSocket use efficient polling?
      • From: Ladd Van Tol <email@hidden>
References: 
 >Re: Does CFSocket use efficient polling? (From: Scott Ribe <email@hidden>)
 >Re: Does CFSocket use efficient polling? (From: Josh Graessley <email@hidden>)
 >Re: Does CFSocket use efficient polling? (From: Ladd Van Tol <email@hidden>)
 >Re: Does CFSocket use efficient polling? (From: Jens Alfke <email@hidden>)
 >Re: Does CFSocket use efficient polling? (From: Mark Pauley <email@hidden>)

  • Prev by Date: Re: Does CFSocket use efficient polling?
  • Next by Date: Re: Does CFSocket use efficient polling?
  • Previous by thread: Re: Does CFSocket use efficient polling?
  • Next by thread: Re: Does CFSocket use efficient polling?
  • Index(es):
    • Date
    • Thread