Re: Does CFSocket use efficient polling?
Re: Does CFSocket use efficient polling?
- Subject: Re: Does CFSocket use efficient polling?
- From: Ladd Van Tol <email@hidden>
- Date: Fri, 13 Feb 2009 18:45:30 -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:
Did that for the Mac test case, as you'll see in the code. On the
iPhone, I wound up throwing away the data.
- Ladd
_______________________________________________
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