• 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: NSFileWrapper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileWrapper


  • Subject: Re: NSFileWrapper
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 04 Jun 2016 14:41:00 -0700
  • Feedback-id: 167118m:167118agrif8a:167118ssIYRKNYGP:SMTPCORP

On Jun 4, 2016, at 14:10 , Markus Spoettl <email@hidden> wrote:
>
> you have complete control over what individual file you read and when

That’s fine for documents where it’s helpful not to have to read files only to write them out unchanged on a save.

It doesn’t really help when you need to read large amounts of data. The problem is that NSFileWrapper doesn’t AFAIK have any API to get already-read files out of memory. In terms of eventual memory usage, it’s the same whether you read 1 large file or 100 small ones.

Compounding this problem is that it’s typical for the file data to be an archive, which means that when you unarchive it you’re using twice the memory — once for the archive (a NSData object retained by the file wrapper) and once for the re-created objects.

This is mitigated in common use, because the files can often be mapped rather than read via I/O APIs, so they use address space, but not necessarily much memory.

I find the documentation lacking in this regard, because it fails to distinguish between large documents that only need to be read selectively, usually, and large documents that need to be read partially. NSDocument has API for the latter, but it’s buried pretty deep.

_______________________________________________

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: 
 >NSFileWrapper (From: Peter Hudson <email@hidden>)
 >Re: NSFileWrapper (From: Mike Abdullah <email@hidden>)
 >Re: NSFileWrapper (From: Peter Hudson <email@hidden>)
 >Re: NSFileWrapper (From: Jens Alfke <email@hidden>)
 >Re: NSFileWrapper (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: NSFileWrapper
  • Next by Date: Re: Sorry to ask again, but maybe I'm asking the question incorrectly. Remote Notifications outside app delegate.
  • Previous by thread: Re: NSFileWrapper
  • Next by thread: Re: NSFileWrapper
  • Index(es):
    • Date
    • Thread