On Thu, Jun 2, 2011 at 2:51 PM, Norbert Hartl <norbert@hartl.name> wrote:
Am 02.06.2011 um 14:31 schrieb Mariano Martinez Peck:
Thanks Norbert. Now I could successfully run benchmarks for SIXX and compare with Fuel. But that's not really fare because we are comparing a text based serializer against a binary one.
It is interesting anyway. I like to know if it is 20 times faster or even more.
From my benchmarks, when serializing to a file, I can see:
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@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