Re: Splitting model I/O for optimization
Re: Splitting model I/O for optimization
- Subject: Re: Splitting model I/O for optimization
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sun, 2 Nov 2008 02:31:38 +0100
Le 1 nov. 08 à 09:31, Oleg Krupnov a écrit :
In my app all model data are saved in a single file. For the purpose
of optimizing file I/O, I'm looking for a solution that would not
force me to resave the entire model when only a tiny bit of it has
changed, and also allow loading (fetching) the model only partially -
lazily upon request.
A solution for this problem could be saving different parts of the
model in different archive files using
NSKeyedArchiver/NSKeyedUnarchiver. However, this only works when there
are no cross-references between the parts of the model that need to be
saved. AFAIU, upon loading, any saved cross-reference would create a
new copy of the object that would not map to the same model object. Is
there a work around this problem?
Another solution that seems feasible is a kind of file mapping into
memory, i.e. there is a single large file but accessed randomly like
memory. However, I am not sure there is such thing in Cocoa and also
if it really gives any performance gain.
File mapping can be performed using standards libc functions, and you
can also use -[NSData initWithContentsOfMappedFile:]
I don't know if it solve your problem, but with that, you will be able
to perform some tests.
_______________________________________________
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