Re: Need advice about [NSInputStream read:maxLength:] performance.
Re: Need advice about [NSInputStream read:maxLength:] performance.
- Subject: Re: Need advice about [NSInputStream read:maxLength:] performance.
- From: Jens Alfke <email@hidden>
- Date: Thu, 17 Sep 2015 08:58:42 -0700
On Sep 17, 2015, at 2:24 AM, Motti Shneor < email@hidden> wrote:
Is there a specific penalty to NSStream’s method read:maxLength: ? If I call it on the average 2-3 times a message, Is this far worse than reading big bulks off the stream, then doing all my book-keeping and copying and locking?
It depends on how often you’re calling it, and the relative cost of reading vs parsing vs handling messages. In most use cases the kernel call overhead isn’t very significant. IIRC, you haven’t given us any specific numbers, or any indication that this is a super-high-performance situation.
Last, several guys mentioned GCDAsyncSocket. What is it? an open-source thing? a system API I’m not aware of?
Or alternatively, right-click on ‘GCDAsyncSocket’ and choose “Search With Google” from the context menu. I’m not trying to be snarky, just pointing out that these days asking “what is X” is usually slower than looking it up yourself.
—Jens |
_______________________________________________
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