Hi Chris,<br><br>Sorry for my delay, thank you very much for your answer and for the tips about benchmarking. I also agree in that both serializers have different purposes and so different features and limitations and so looking who is the fastest is not the best comparison.<br>
<br>Another question: have you benchmarked the memory use while serializing or materializing? I have never. I know that there is something called SpaceTally but I don't know about it.<br><br>Cheers,<br>Martin<br> <br>
<br><div class="gmail_quote">On Fri, Jun 3, 2011 at 1:30 PM, Chris Muller <span dir="ltr"><<a href="mailto:ma.chris.m@gmail.com">ma.chris.m@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">>> - Instantiatation / initialization of a MaObjectSerializer.<br>
>> - Serialization of object graphs of various sizes.<br>
><br>
> If you have by chance some code snippets to generate graphs for testing<br>
> (maybe you have that in Magma) let us know :)<br>
> We can a pice of code that generates binary trees...<br>
<br>
</div>Yes, see MaFixtureFactory.<br>
<br>
MaFixtureFactory current samples<br>
<br>
or<br>
<br>
MaFixtureFactory current knot<br>
<br>
There was a discussion recently about comparing object graphs -- you<br>
may be interested in MaObjectSerializerTester, and how it verifies<br>
serialized-->remateralized object graphs of any shape against the<br>
original fixture graph. Very useful for ensuring your serializer is<br>
_working_. :) See MaObjectSerializerTestCase>>#testSamples which<br>
sends #maEquivalentForSerializationTest: to determine that..<br>
<div class="im"><br>
>> "Serialization"<br>
>> | obj ser |<br>
>> obj := Array with: 1 with: 'string'.<br>
>> ser := MaObjectSerializer new.<br>
>> [ ser serializeGraph: obj ] bench<br>
>><br>
><br>
> With the rest of the serializers that we do is to serialize the graph into a<br>
> file. How could we do this with Magma Serializer?<br>
> because serializeGraph: answers a MaSerializedGraphBuffer. So, I guess I can<br>
> ask the byteArray to it and do a nextPutAll: or something like that to our<br>
> stream?<br>
<br>
</div>Yes. I, of course, always appreciated the elegance of the notion that<br>
MaObjectSerializer could operate directly on Streams, but the problem<br>
is that I also want a secure client-server protocol which wraps the<br>
serialized requests and responses. So to, for example, calculate a<br>
MAC, the full byteArray of the request is required in advance. It's<br>
ok though, serialized / materialized objects have to fit into memory<br>
anyway, so a streaming API doesn't really offer any practical<br>
advantage - just elegance.<br>
<div class="im"><br>
> We also have in Fuel what we call "in memory serialization" that basically<br>
> returns the byteArray and then we can materialize from that. So this case<br>
> would be similar to this usage of Magma, wouldn't it ?<br>
<br>
</div>Yeah - similar to use of "Ma object serializer". (IOW, you don't have<br>
to load Magma to use MaObjectSerializer), you can just load MaBase.<br>
<div class="im"><br>
>> As I said, benching is tricky, and publishing comparisons even<br>
>> trickier<br>
><br>
> yes, exactly. The problem is in addition that there are supported features<br>
> of a serializer that inpacts on the results of a benchmark. For example,<br>
> supported class reshapes, initialization after materialization, support<br>
> transient instVars...etc... to support all those things you usually spend<br>
> more time. So maybe you support all that and in the results you are slower<br>
> in comparisson with someone that do not support that. So yes, measuring<br>
> speed only is not good. But taking into account the rest of the properties<br>
> is better.<br>
<br>
</div>Yip! Glad you said that.<br>
<font color="#888888"><br>
- Chris<br>
</font></blockquote></div><br>