> On Mar 1, 2014, at 11:11 , Trygve Inda <cocoa...@xericdesign.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to