Re: Progress for archiving/dearchiving

2013-09-18 Thread Marcel Weiher
On Sep 17, 2013, at 17:35 , Fritz Anderson wrote: >> On Sep 16, 2013, at 18:51 , Jeffrey Oleander wrote: >> >>> If you want to know the total number of objects to be archived, then you >>> need to count them, at some time or another. To count them, you need to >>> walk the object tree before

Re: Progress for archiving/dearchiving

2013-09-17 Thread Fritz Anderson
On 17 Sep 2013, at 2:38 AM, Marcel Weiher wrote: > On Sep 16, 2013, at 18:51 , Jeffrey Oleander wrote: > >> If you want to know the total number of objects to be archived, then you >> need to count them, at some time or another. To count them, you need to >> walk the object tree before you

Re: Progress for archiving/dearchiving

2013-09-17 Thread Marcel Weiher
On Sep 17, 2013, at 10:03 , Graham Cox wrote: > This is very much a worst-case. The file contains a 400MB embedded TIFF > image, which is the bottleneck. The archive probably only has a thousand > objects in it. Ahh, so the ‘other' case: rather than large numbers of objects, a few really l

Re: Progress for archiving/dearchiving

2013-09-17 Thread Graham Cox
On 17/09/2013, at 10:03 AM, Graham Cox wrote: > But you can't opt into one without the other. Actually, that's not true… but as it happens I have opted in to concurrent reading, even though I'm not sure of its benefits - just seems to be what is expected these days. --Graham _

Re: Progress for archiving/dearchiving

2013-09-17 Thread Graham Cox
On 17/09/2013, at 9:47 AM, Marcel Weiher wrote: > Wow, that’s a pretty big file! NSKeyedArchiver has been heavily optimized > (relatively speaking) for the reading case, so 10-15 seconds sounds like a > lot, my 1M object graph “only" takes around 2-3 seconds. This is very much a worst-case.

Re: Progress for archiving/dearchiving

2013-09-17 Thread Marcel Weiher
Hi Graham! On Sep 16, 2013, at 20:26 , Graham Cox wrote: > Documents get saved in the background, so in some ways it doesn't matter how > long they take, but when waiting for a very big file to open, there can be a > noticeable delay (maybe 10-15 seconds) between the Open dialog going away and

Re: Progress for archiving/dearchiving

2013-09-17 Thread Marcel Weiher
On Sep 16, 2013, at 18:51 , Jeffrey Oleander wrote: > If you want to know the total number of objects to be archived, then you > need to count them, at some time or another. To count them, you need to walk > the object tree before you start actually archiving... which may take a > signifi

Re: Progress for archiving/dearchiving

2013-09-16 Thread Gerriet M. Denkmann
On 17 Sep 2013, at 00:26, Graham Cox wrote: > > What I was sort of hoping was that there was a way to figure out from the > archive how many objects there were without having to archive the number > explicitly. For example, the root level of an archive is a dictionary, which > has a count, b

Re: Progress for archiving/dearchiving

2013-09-16 Thread Jeffrey Oleander
On 2013 Sep 16, at 08:53, Graham Cox wrote: If I wanted to add some sort of progress reporting to archiving and dearchiving, what's a good way to do it? The problem seems to me to know what the 'count' of things read from/written to the file is to set the progress max value. Since the delegate

Re: Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
On 16/09/2013, at 4:25 PM, Chris Devereux wrote: > How about tracking the number of written objects when saving the document, > then encoding an additional key containing the object count at the top > level of the archive? This could then be retrieved before decoding the root > object. > > A po

Re: Progress for archiving/dearchiving

2013-09-16 Thread Chris Devereux
Another angle worth looking at: Depending on the output format you're using with NSKeyedArchiver, your file might already contain an object count, even if the API doesn't expose it. According to the Cocotron source[1], the binary plist format actually does this. It won't correspond exactly to the

Re: Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
On 16/09/2013, at 6:51 PM, Jeffrey Oleander wrote: > I'll bite. If you want to know the total number of objects to be archived, > then you need to count them, at some time or another. To count them, you > need to walk the object tree before you start actually archiving... which > may take

Re: Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
On 16/09/2013, at 8:08 PM, Jeffrey Oleander wrote: > Yes, of course, you can. But that is too late. > You need to know the total, the max, before you display the progress bar Ah, true but in fact displaying progress when dearchiving is more important. Documents get saved in the background, s

Re: Progress for archiving/dearchiving

2013-09-16 Thread Chris Devereux
How about tracking the number of written objects when saving the document, then encoding an additional key containing the object count at the top level of the archive? This could then be retrieved before decoding the root object. A possible problem with this idea is that it might require the data

Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
Hi all, If I wanted to add some sort of progress reporting to archiving and dearchiving, what's a good way to do it? The problem seems to me to know what the 'count' of things read from/written to the file is to set the progress max value. Since the delegate gets called for each object instanti