Magma object serializer

Chris Muller asqueaker at gmail.com
Fri Jun 3 01:23:43 UTC 2011


Hi Martin and Mariano, thanks for asking.  The answer depends on what
you want to measure.  Benchmarking software as complex as a serializer
is tricky because, as you know, there are multiple functions to
measure which are used independently in various real-world use-cases.

To gain a meaningful understanding of the performance, you need to
bench the most-atomic level of operations a user of a serializer would
use individually.

  - Instantiatation / initialization of a MaObjectSerializer.
  - Serialization of object graphs of various sizes.
  - Materialization of said graphs.
  - Also, if doing comparisons to other serializers (which, I'm
guessing you are) it is crucial to ensure each serializer is
configured to serialize the same number of objects (i.e., the same
depth, etc.) as the other serializers being compared to.
  - It's also important to discover whether any special
configuration-options / preferences which affect the performance can
be used.

So, given the one example object you've provided, here are some
starter scripts which could be used for benching useful serialization
operations with MaObjectSerializer.

"Initialization"
[ MaObjectSerializer new ] bench.

"Serialization"
| obj ser |
obj := Array with: 1 with: 'string'.
ser := MaObjectSerializer new.
[ ser serializeGraph: obj ] bench

"Materialization"
| obj ser ba |
obj := Array with: 1 with: 'string'.
ser := MaObjectSerializer new.
ba := (ser serializeGraph: obj) byteArray.
[ ser materializeGraph: ba ] bench

I have not researched any speed optimizations of MaObjectSerializer in
many years, so I'm sure it will not be as fast as Fuel if it was
designed for speed from the ground up.  I need to profile and revisit
performance aspects of MaObjectSerializer.

As I said, benching is tricky, and publishing comparisons even
trickier, and so I do appreciate your asking for my input and hope
whatever you publish to the world will be based on fair, responsible
measuring.  Toward that end, I support you and thank you for your work
on Fuel.

Regards,
  Chris



On Thu, Jun 2, 2011 at 12:14 AM, Martin Dias <tinchodias at gmail.com> wrote:
> Hi,
>
> I want to run some benchmarks with the Magma object serializer... Am I using
> it in the right way?
>
> Thanks!!
> Martin
>
>
>     | serializer graphBuffer anObject classDefinitionsByteArray
> graphBufferByteArray loadedObject |
>
>     anObject := Array with: 1 with: 'string'.
>
>     serializer := MaObjectSerializer new.
>     graphBuffer := serializer serializeGraph: anObject.
>
>     classDefinitionsByteArray := serializer classDefinitionsByteArray.
>     graphBufferByteArray := graphBuffer byteArray.
>
>     "put these two bytearrays into a stream, and reload them..."
>
>     loadedObject := MaObjectSerializer new
>         classDefinitionsByteArray: classDefinitionsByteArray;
>         materializeGraph: graphBufferByteArray
>
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
>


More information about the Magma mailing list