• 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: NSFileHandle, performance of socket writing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileHandle, performance of socket writing


  • Subject: Re: NSFileHandle, performance of socket writing
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 28 May 2008 08:13:58 -0700


On 28 May '08, at 2:18 AM, Doo-Hyun Jang wrote:

- 24.9% mach_kernel ml_set_interrupts_enabled
 ...
 ...
      - 15.9% mach_kernel find_user_regs

That just shows the time your thread spent blocked (it's down inside thread_block). CFNetwork classes do the real I/O on a background thread, typically, so you'd need to look at where all your threads are spending time.


Also, it's probably not CPU time that's slowing down the app. I would guess that you're sending the packets inefficiently (either many tiny packets, or waiting too long between sends.)

NSFileHandle *mSocketHandle;
...
[mSocketHandle writeData:[aPacket data]];

How many bytes are the packets? Could you show the loop that sends them?
Also, what code is receiving them on the other end? That could slow the whole transfer down too.


is it osx's system problem?

Not at all. The OS will have no trouble using all the bandwidth your network connection can give it. There must be something wrong in the way the app is providing the data. Show us a bit more of the code and we can help.


—Jens

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

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSFileHandle, performance of socket writing (From: "Doo-Hyun Jang" <email@hidden>)

  • Prev by Date: Re: Cover Flow in Cocoa?
  • Next by Date: Re: if statement
  • Previous by thread: NSFileHandle, performance of socket writing
  • Next by thread: Time management
  • Index(es):
    • Date
    • Thread