std.serialization: pre-voting review / discussion

Tyler Jameson Little beatgammit at gmail.com
Wed Aug 14 02:15:11 PDT 2013


On Wednesday, 14 August 2013 at 08:48:23 UTC, Jacob Carlborg 
wrote:
> On 2013-08-14 10:19, Tyler Jameson Little wrote:
>> Serious:
>>
>> - doesn't use ranges
>>   - does this store the entire serialized output in memory?
>
> That's up to the archive how it chooses to implement it. But 
> the current XmlArchive does so, yes. I becomes quite limited 
> because of std.xml.

Well, std.xml needs to be replaced anyway, so it's probably not a 
good limitation to have. It may take some work to replace it 
correctly though...

>>   - I would to serialize to a range (file?) and deserialize 
>> from a
>> range (file?)
>
> The serialized data is returned as an array, so that is 
> compatible with the range interface, it just won't be lazy.
>
> The input data used for deserializing excepts a void[], I don't 
> think that's compatible with the range interface.

I'm mostly interested in reducing memory. If I'm (de)serializing 
a large object or lots of objects, this could become an issue.

Related question: Have you looked at how much this relies on the 
GC?

>> Minor
>>
>> - Indentation messed up in Serializable example
>
> Right, I'll fix that.
>
>> - Typo: NonSerialized example should read NonSerialized!(b)
>
> No, it's not a typo. If you read the documentation you'll see 
> that:
>
> "If no fields or "this" is specified, it indicates that the 
> whole class/struct should not be (de)serialized."

Ah, missed that.


More information about the Digitalmars-d mailing list