No subject


Thu May 12 15:35:49 CEST 2011


SIXX Total milliseconds for serialization: 169696
SIXX Total milliseconds for materialization: 80622
SIXX Total milliseconds: 250318

For serialization, Fuel is 35.22 times faster than SIXX
For materialization, Fuel is 120.51 times faster than SIXX

Fuel Total milliseconds for serialization: 4818
Fuel Total milliseconds for materialization: 669
Fuel Total milliseconds: 5487



> On the other hand it is not fair either. I don't know fuel but I think it
> platform dependent, right?
>

Yes. We are dependent in the way that we do special serialization for
certain types of objects which may be different to another dialect.
For example,

FLFloatCluster >> serialize: aFloat on: aWriteStream

    aWriteStream
        nextNumber: 4 put: (aFloat at: 1);
        nextNumber: 4 put: (aFloat at: 2).

FLLargePositiveIntegerCluster >> serialize: anInteger on: aWriteStream

    | size byte |
    size:=(anInteger log: 256) floor + 1.
    aWriteStream nextPut: size.
    (size - 1 to: 0 by: -1) do:
        [:index |
        byte := (anInteger bitShift: index * -8) bitAnd: 255.
        aWriteStream nextPut: byte]


FLPositiveSmallIntegerCluster >> serialize: anInteger on: aWriteStream

    aWriteStream nextPut: (anInteger bitShift: -24).
    aWriteStream nextPut: ((anInteger bitShift: -16) bitAnd: 255).
    aWriteStream nextPut: ((anInteger bitShift: -8) bitAnd: 255).
    aWriteStream nextPut: (anInteger bitAnd: 255).


etc.....
So...if you want to port Fuel to say Gemstone you will have to adapt those
special guys.

So it is not fair the other way round because you compare a cross-platform
> serializer with a platform-dependent one ;) I think these are the categories
> that people think about when the are about to choose what util to use.
>
>
I cannot agree more :)



> Norbert
>
> Mariano
>
> On Thu, Jun 2, 2011 at 12:14 PM, Norbert Hartl <norbert at hartl.name> wrote:
>
>>
>> Am 02.06.2011 um 11:42 schrieb Mariano Martinez Peck:
>>
>> >> serialize: anObject on: aStream
>>     | sws |
>>     sws := SixxWriteStream on: aStream.
>>     sws nextPut: anObject.
>>     sws close.
>>
>> serialize: anObject on: aStream
>>    anObject sixxOn: aStream
>>
>>
>> >> materializeFrom: aStream
>>     | srs objects |
>>     srs := SixxReadStream on: aStream.
>>     objects := srs contents.
>>     srs close.
>>     ^ objects
>>
>>
>> materializeFrom: aStream
>> ^ Object readSixxFrom: aStream
>>
>> Norbert
>>
>>
>>
>> Is that correct or I am doing it wrong?  All I want to do is to serialize
>> a graph into a stream.
>>
>> The stream I am using is or this:
>>
>> (FileDirectory default forceNewFileNamed:  'Bench')
>>
>> or
>>
>> (RWBinaryOrTextStream on: '')
>>
>>
>> I am not sure if I should be doing a #nextPut: or a #nextPutAll:. I mean,
>> sometimes anObject is a collection and sometimes it is not. So, which one
>> should I use?
>>
>> Thanks
>>
>> Mariano
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>


-- 
Mariano
http://marianopeck.wordpress.com

--001636ed731341e7a604a4ba3759
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Thu, Jun 2, 2011 at 2:51 PM, Norbert =
Hartl <span dir=3D"ltr">&lt;<a href=3D"mailto:norbert at hartl.name">norbert at h=
artl.name</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style=3D"word-wrap:break-word"><br><div><div>Am 02.06.2011 um 14:31 sc=
hrieb Mariano Martinez Peck:</div><div class=3D"im"><br><blockquote type=3D=
"cite">Thanks Norbert. Now I could successfully run benchmarks for SIXX and=
 compare with Fuel. But that&#39;s not really fare because we are comparing=
 a text based serializer against a binary one.<br>
<br></blockquote></div>It is interesting anyway. I like to know if it is 20=
 times faster or even more.</div></div></blockquote><div><br>From my benchm=
arks, when serializing to a file, I can see:<br><br>SIXX Total milliseconds=
 for serialization: 169696<br>
SIXX Total milliseconds for materialization: 80622<br>SIXX Total millisecon=
ds: 250318<br><br style=3D"background-color: rgb(255, 255, 51);"><span styl=
e=3D"background-color: rgb(255, 255, 51);">For serialization, Fuel is 35.22=
 times faster than SIXX</span><br style=3D"background-color: rgb(255, 255, =
51);">
<span style=3D"background-color: rgb(255, 255, 51);">For materialization, F=
uel is 120.51 times faster than SIXX</span><br><br>Fuel Total milliseconds =
for serialization: 4818<br>Fuel Total milliseconds for materialization: 669=
<br>
Fuel Total milliseconds: 5487<br><br>=A0</div><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 20=
4, 204); padding-left: 1ex;"><div style=3D"word-wrap: break-word;"><div> On=
 the other hand it is not fair either. I don&#39;t know fuel but I think it=
 platform dependent, right?</div>
</div></blockquote><div><br>Yes. We are dependent in the way that we do spe=
cial serialization for certain types of objects which may be different to a=
nother dialect. <br>For example, <br><br>FLFloatCluster &gt;&gt; serialize:=
 aFloat on: aWriteStream<br>
<br>=A0=A0=A0 aWriteStream <br>=A0=A0=A0 =A0=A0=A0 nextNumber: 4 put: (aFlo=
at at: 1);<br>=A0=A0=A0 =A0=A0=A0 nextNumber: 4 put: (aFloat at: 2).<br><br=
>FLLargePositiveIntegerCluster &gt;&gt; serialize: anInteger on: aWriteStre=
am<br><br>=A0=A0=A0 | size byte |<br>
=A0=A0=A0 size:=3D(anInteger log: 256) floor + 1.<br>=A0=A0=A0 aWriteStream=
 nextPut: size.<br>=A0=A0=A0 (size - 1 to: 0 by: -1) do:<br>=A0=A0=A0 =A0=
=A0=A0 [:index |<br>=A0=A0=A0 =A0=A0=A0 byte :=3D (anInteger bitShift: inde=
x * -8) bitAnd: 255.<br>=A0=A0=A0 =A0=A0=A0 aWriteStream nextPut: byte]<br>
<br><br>FLPositiveSmallIntegerCluster &gt;&gt; serialize: anInteger on: aWr=
iteStream<br><br>=A0=A0=A0 aWriteStream nextPut: (anInteger bitShift: -24).=
<br>=A0=A0=A0 aWriteStream nextPut: ((anInteger bitShift: -16) bitAnd: 255)=
.<br>=A0=A0=A0 aWriteStream nextPut: ((anInteger bitShift: -8) bitAnd: 255)=
.<br>
=A0=A0=A0 aWriteStream nextPut: (anInteger bitAnd: 255).<br><br><br>etc....=
. <br>So...if you want to port Fuel to say Gemstone you will have to adapt =
those special guys. <br><br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); p=
adding-left: 1ex;">
<div style=3D"word-wrap: break-word;"><div> So it is not fair the other way=
 round because you compare a cross-platform serializer with a platform-depe=
ndent one ;) I think these are the categories that people think about when =
the are about to choose what util to use.</div>
<div><br></div></div></blockquote><div><br>I cannot agree more :)<br><br>=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8=
ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div sty=
le=3D"word-wrap: break-word;">
<div></div><font color=3D"#888888"><div>Norbert</div></font><div><div></div=
><div class=3D"h5"><div><br><blockquote type=3D"cite">Mariano<br><br><div c=
lass=3D"gmail_quote">
On Thu, Jun 2, 2011 at 12:14 PM, Norbert Hartl <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:norbert at hartl.name" target=3D"_blank">norbert at hartl.name</a>&gt=
;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
.8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style=3D"word-wrap:break-word"><div><br></div><div><div>Am 02.06.2011 =
um 11:42 schrieb Mariano Martinez Peck:</div><div><br><blockquote type=3D"c=
ite">&gt;&gt; serialize: anObject on: aStream<br>=A0=A0=A0 | sws |<br>
=A0=A0=A0 sws :=3D SixxWriteStream on: aStream.<br>=A0=A0=A0 sws nextPut: a=
nObject.<br>=A0=A0=A0 sws close.<br><br></blockquote></div>serialize: anObj=
ect on: aStream</div><div>=A0=A0 anObject sixxOn: aStream</div><div><div><b=
r><blockquote type=3D"cite">

<br>&gt;&gt; materializeFrom: aStream<br>=A0=A0=A0 | srs objects |<br>=A0=
=A0=A0 srs :=3D SixxReadStream on: aStream.<br>
=A0=A0=A0 objects :=3D srs contents.<br>=A0=A0=A0 srs close.<br>=A0=A0=A0 ^=
 objects<br></blockquote><div><br></div></div>materializeFrom: aStream</div=
><div><span style=3D"white-space:pre-wrap">	</span>^ Object readSixxFrom: a=
Stream</div><div>

<br></div><div><font color=3D"#888888">Norbert</font><div><br><blockquote t=
ype=3D"cite">=A0=A0=A0 <br><br>Is that correct or I am doing it wrong?=A0 A=
ll I want to do is to serialize a graph into a stream.<br><br>The stream I =
am using is or this:<br>

<br>
(FileDirectory default forceNewFileNamed:=A0 &#39;Bench&#39;)<br><br>or<br>=
<br>(RWBinaryOrTextStream on: &#39;&#39;) <br><br><br>I am not sure if I sh=
ould be doing a #nextPut: or a #nextPutAll:. I mean, sometimes anObject is =
a collection and sometimes it is not. So, which one should I use?<br>


<br>Thanks<br><br>Mariano<br><br clear=3D"all"><br>-- <br>Mariano<br><a hre=
f=3D"http://marianopeck.wordpress.com/" target=3D"_blank">http://marianopec=
k.wordpress.com</a><br><br>
</blockquote></div></div><br></div></blockquote></div><br><br clear=3D"all"=
><br>-- <br>Mariano<br><a href=3D"http://marianopeck.wordpress.com/" target=
=3D"_blank">http://marianopeck.wordpress.com</a><br><br>
</blockquote></div><br></div></div></div></blockquote></div><br><br clear=
=3D"all"><br>-- <br>Mariano<br><a href=3D"http://marianopeck.wordpress.com"=
 target=3D"_blank">http://marianopeck.wordpress.com</a><br><br>

--001636ed731341e7a604a4ba3759--



More information about the Pharo-project mailing list