• 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: NSDocument save incremental file package in-place
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument save incremental file package in-place


  • Subject: Re: NSDocument save incremental file package in-place
  • From: Trygve Inda <email@hidden>
  • Date: Sat, 01 Mar 2014 14:26:20 -0800
  • Thread-topic: NSDocument save incremental file package in-place

> On Mar 1, 2014, at 11:11 , Trygve Inda <email@hidden> wrote:
>
>> I really need this to be faster.
>
> I think the point I was trying to reach was that your next step is to
> investigate what is taking the time. IIRC there’s a NSURL attribute key you
> can use to retrieve a file’s inode number, so you can check programmatically
> whether the saved document is correctly using hard links. You could also
> investigate what per-file performance to expect from hard-linking using some
> test code. Or, there might be an Instruments template that gives some insight
> into the basis for the slow saves.
>
>> It should happen almost instantly
>
> What is the basis for this “should”? It sounds like your expectation is based
> on a (hypothetical) save strategy that isn’t safe.

Instruments says (for all 7500 files)

_NSReadBytesFromFile
-[NSData(NSData) writeToFile:options:error:]
-[NSFileManager setAttributes:ofItemAtPath:error:]   // doing a chmod 420
_NSWriteBytesToFileWithExtendedAttributes

My read method

-(BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper ofType:(NSString
*)typeName error:(NSError **)outError

(this calls [self setDocumentFileWrapper:fileWrapper]; to save the wrapper)

My write method:

-(NSFileWrapper *)fileWrapperOfType:(NSString *)typeName error:(NSError
**)outError

for testing, this simply returns the same wrapper:

return documentFileWrapper;


If I read in a package with 7500 files, it takes 40-60 seconds to save (note
that I an NOT doing save As).





_______________________________________________

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


  • Prev by Date: Re: NSDocument save incremental file package in-place
  • Next by Date: Re: NSDocument save incremental file package in-place
  • Previous by thread: Re: NSDocument save incremental file package in-place
  • Next by thread: Auto center within a custom NSView
  • Index(es):
    • Date
    • Thread