<br><br><div class="gmail_quote">On Fri, Jun 3, 2011 at 3:23 AM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Martin and Mariano, thanks for asking.  The answer depends on what<br>
you want to measure.  Benchmarking software as complex as a serializer<br>
is tricky because, as you know, there are multiple functions to<br>
measure which are used independently in various real-world use-cases.<br>
<br></blockquote><div><br>Yes, exactly. <br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
To gain a meaningful understanding of the performance, you need to<br>
bench the most-atomic level of operations a user of a serializer would<br>
use individually.<br>
<br>
  - Instantiatation / initialization of a MaObjectSerializer.<br>
  - Serialization of object graphs of various sizes.<br></blockquote><div><br>If you have by chance some code snippets to generate graphs for testing (maybe you have that in Magma) let us know :)<br>We can a pice of code that generates binary trees...<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
  - Materialization of said graphs.<br>
  - Also, if doing comparisons to other serializers (which, I&#39;m<br>
guessing you are) it is crucial to ensure each serializer is<br>
configured to serialize the same number of objects (i.e., the same<br>
depth, etc.) as the other serializers being compared to.<br>
  - It&#39;s also important to discover whether any special<br>
configuration-options / preferences which affect the performance can<br>
be used.<br></blockquote><div><br>yes, exactly. This is the most complicated when you do not know that much the serializer. That&#39;s why we were asking :)<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
So, given the one example object you&#39;ve provided, here are some<br>
starter scripts which could be used for benching useful serialization<br>
operations with MaObjectSerializer.<br>
<br>
&quot;Initialization&quot;<br>
[ MaObjectSerializer new ] bench.<br>
<br>
&quot;Serialization&quot;<br>
| obj ser |<br>
obj := Array with: 1 with: &#39;string&#39;.<br>
ser := MaObjectSerializer new.<br>
[ ser serializeGraph: obj ] bench<br>
<br></blockquote><div><br>With the rest of the serializers that we do is to serialize the graph into a file. How could we do this with Magma Serializer?<br>because serializeGraph: answers a MaSerializedGraphBuffer. So, I guess I can ask the byteArray to it and do a nextPutAll: or something like that to our stream?<br>
We also have in Fuel what we call &quot;in memory serialization&quot; that basically returns the byteArray and then we can materialize from that. So this case would be similar to this usage of Magma, wouldn&#39;t it ?<br>
<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
&quot;Materialization&quot;<br>
| obj ser ba |<br>
obj := Array with: 1 with: &#39;string&#39;.<br>
ser := MaObjectSerializer new.<br>
ba := (ser serializeGraph: obj) byteArray.<br>
[ ser materializeGraph: ba ] bench<br></blockquote><div><br><br>The same question of serializtion.<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
I have not researched any speed optimizations of MaObjectSerializer in<br>
many years, so I&#39;m sure it will not be as fast as Fuel if it was<br>
designed for speed from the ground up.  I need to profile and revisit<br>
performance aspects of MaObjectSerializer.<br></blockquote><div><br>No problem. Speed is only one more measure and only needed in certain scenarios. And usually speed comes together with trade-offs. In addition, you cannot compare a serializer of a database to a general-purpose serializer. Even if magma serializr could be used outside magma. There are a lot of things that Magma Serializer has to do that maybe other do not need, or things you cannot do because of magma. So, each serializer has its own goals. <br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
As I said, benching is tricky, and publishing comparisons even<br>
trickier</blockquote><div><br>yes, exactly. The problem is in addition that there are supported features of a serializer that inpacts on the results of a benchmark. For example, supported class reshapes, initialization after materialization, support transient instVars...etc... to support all those things you usually spend more time. So maybe you support all that and in the results you are slower in comparisson with someone that do not support that. So yes, measuring speed only is not good. But taking into account the rest of the properties is better.<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">, and so I do appreciate your asking for my input and hope<br>
whatever you publish to the world will be based on fair, responsible<br>
measuring.  Toward that end, I support you and thank you for your work<br>
on Fuel.<br>
<br></blockquote><div><br>Thanks Chris. <br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Regards,<br>
  Chris<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Thu, Jun 2, 2011 at 12:14 AM, Martin Dias &lt;<a href="mailto:tinchodias@gmail.com">tinchodias@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I want to run some benchmarks with the Magma object serializer... Am I using<br>
&gt; it in the right way?<br>
&gt;<br>
&gt; Thanks!!<br>
&gt; Martin<br>
&gt;<br>
&gt;<br>
&gt;     | serializer graphBuffer anObject classDefinitionsByteArray<br>
&gt; graphBufferByteArray loadedObject |<br>
&gt;<br>
&gt;     anObject := Array with: 1 with: &#39;string&#39;.<br>
&gt;<br>
&gt;     serializer := MaObjectSerializer new.<br>
&gt;     graphBuffer := serializer serializeGraph: anObject.<br>
&gt;<br>
&gt;     classDefinitionsByteArray := serializer classDefinitionsByteArray.<br>
&gt;     graphBufferByteArray := graphBuffer byteArray.<br>
&gt;<br>
&gt;     &quot;put these two bytearrays into a stream, and reload them...&quot;<br>
&gt;<br>
&gt;     loadedObject := MaObjectSerializer new<br>
&gt;         classDefinitionsByteArray: classDefinitionsByteArray;<br>
&gt;         materializeGraph: graphBufferByteArray<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Magma mailing list<br>
&gt; <a href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/magma" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/magma</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>