October 10, 2013
On Thursday, 10 October 2013 at 07:45:51 UTC, Jacob Carlborg wrote:
> ...

I thought the very point of output ranges is that you can output in any chunks that seem most convenient / efficient to you.
October 10, 2013
On 2013-10-10 14:13, Dicebot wrote:

> I thought the very point of output ranges is that you can output in any
> chunks that seem most convenient / efficient to you.

Outputting it like the first suggestion will be a lot more convenient, especially how std.xml currently works. Although it will probably not be as efficient. This basically means a complete object graph will be outputted in one chunk. That is, unless the top element is a range.

-- 
/Jacob Carlborg
October 10, 2013
10-Oct-2013 11:45, Jacob Carlborg пишет:
> On 2013-08-27 22:12, Dmitry Olshansky wrote:
>
>> Feel free to nag me on the NG and personally for any deficiency you come
>> across on the way there ;)
>
> I'm bumping this again with a new question. I'm thinking about how to
> output the data to output range. If the output range is of type ubyte[]
> how should I output serialized data looking like this:
>
> <object runtimeType="main.Foo" type="main.Foo" key="0" id="0">
>      <int key="a" id="1">3</int>
> </object>
>
> Should I output this in one chunk or in parts like this:
>
> <object runtimeType="main.Foo" type="main.Foo" key="0" id="0">
>
> Then
>
> <int key="a" id="1">3</int>
>
> Then
>
> </object>
>
[snip]

I do believe it's a very minor detail of a specific implementation of XML archiver.

Speaking of Archivers in general the main point is to try to avoid accumulating lots of data in memory if possible and put things as they go.

This however doesn't preclude the 2nd goal - outputting as much as possible in one go (and not 2 chunks) is preferable (1 call vs 2 calls to put of the output range etc) if doesn't harm memory usage (O(1) is OK, anything else not) and doesn't complicate archiver.

-- 
Dmitry Olshansky
1 2 3 4 5 6
Next ›   Last »