Re: Prioritize my own app's disk access
Re: Prioritize my own app's disk access
- Subject: Re: Prioritize my own app's disk access
- From: Jens Alfke <email@hidden>
- Date: Tue, 05 Jul 2016 15:15:45 -0700
> On Jul 5, 2016, at 2:40 PM, Jonathan Taylor <email@hidden> wrote:
>
> As far as the quality of service goes, I can't see the APIs for that (looking in the 10.9 SDK, at least). Am I looking in the wrong place?
IIRC, QoS was added in 10.10.
> I confess that currently I am using pure cocoa -writeToFile:atomically calls. I am fully aware that this is very unlikely to be the best way to do high performance IO, but it's great in terms of convenience.
It probably just opens the file and issues one big write call, which is pretty efficient.
The ways to get more efficient would be to stream the data, if that’s possible — instead of computing everything and then writing it, write the data incrementally while the computation is going on. That interleaves CPU and I/O tasks. It also lowers memory usage, which will help avoid paging.
If the data is too big to fit in RAM but has to be generated up-front, the best approach might be to create the file first, memory-map it as writeable, and then use the mapped address space as the buffer you write the data into.
—Jens
_______________________________________________
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