Protocols

I agree! It’s a little bizarre seeing some of my work ‘exposed’ in such a
way. I see a couple of things to review should I ever get back to my lib
(clxmlserial)

Chris
http://clabs.org

···

----- Original Message -----
On Sunday 16 March 2003 08:58 pm, NAKAMURA, Hiroshi wrote:

I added benchmarks.

Suite: http://rrr.jin.gr.jp/rwiki?cmd=view;name=Marshal%3A%3ABenchmark
Result:
http://rrr.jin.gr.jp/rwiki?cmd=view;name=Marshal%3A%3ABenchmark-Result

This is excellent! Beautiful work, NaHi.

_why

Hi All,

I try to catch up with the conversation here :slight_smile: Does the benchmark mean
that Ruby 1.8’s build-in Marshal routine is the best?

Thanks
Shannon

···

On Mon, 17 Mar 2003 23:25:37 +0900 why the lucky stiff ruby-talk@whytheluckystiff.net wrote:

On Sunday 16 March 2003 08:58 pm, NAKAMURA, Hiroshi wrote:

I added benchmarks.

Suite: http://rrr.jin.gr.jp/rwiki?cmd=view;name=Marshal%3A%3ABenchmark
Result:
http://rrr.jin.gr.jp/rwiki?cmd=view;name=Marshal%3A%3ABenchmark-Result

This is excellent! Beautiful work, NaHi.

_why


Xiangrong Fang xrfang@hotmail.com

Hi,

From: Xiangrong Fang
Sent: Tuesday, March 18, 2003 10:28 AM

I try to catch up with the conversation here :slight_smile:

Welcome!

http://rrr.jin.gr.jp/rwiki?cmd=view;name=Marshal

Does the
benchmark mean
that Ruby 1.8’s build-in Marshal routine is the best?

Yes, where you can choose it, for example, where no cross
language interoperable serialization is needed.

But I did not intend to say 1.8 > 1.6 here
(even if I think so).

Regards,
// NaHi

Thanks. For the purpose of my current program, I don’t need
interoperable serialization. I think ruby’s is ok for me, however, I
don’see very good performance in 1.6.7’s Marshal, so I continue to use
sysread and split to build my hash in memory.

I happen to see a post by Matz saying that there will be big improvement
in 1.8’s Marshal, so I’ll just wait :slight_smile:

···

On Tue, 18 Mar 2003 19:25:10 +0900 “NAKAMURA, Hiroshi” nahi@keynauts.com wrote:

Hi,

From: Xiangrong Fang
Sent: Tuesday, March 18, 2003 10:28 AM

I try to catch up with the conversation here :slight_smile:

Welcome!

http://rrr.jin.gr.jp/rwiki?cmd=view;name=Marshal

Does the
benchmark mean
that Ruby 1.8’s build-in Marshal routine is the best?

Yes, where you can choose it, for example, where no cross
language interoperable serialization is needed.

But I did not intend to say 1.8 > 1.6 here
(even if I think so).

Regards,
// NaHi


Xiangrong Fang xrfang@hotmail.com

Hi Shannon,

I think ruby’s is ok for me, however, I
don’see very good performance in 1.6.7’s Marshal, so I continue to use
sysread and split to build my hash in memory.

I’m getting pretty good speed in Win32 1.6.6 Ruby using Marshal to
decode a string loaded with sysread, ala:

def load(filename)
dat = File.open(filename, “r”) {|f| f.binmode; f.sysread(f.stat.size) }
@entries = Marshal.load(dat)
end

It loads a million-entry hash table (18 meg on disk) in about
15 sec. on my system. (Goes a couple seconds faster if surrounded
with GC.disable/GC.enable, as you mentioned in an earlier post.)

[A 100000-entry version of the hash table, 1.8 meg on disk, as
anticipated, took about 1.5 seconds to load.]

Hope this helps,

Bill

···

From: “Xiangrong Fang” xrfang@hotmail.com

Can you post the code you are testing the timing with?

Marshalling (out) is very slow if marshalling to a string; the solution is
to marshal directly to an IO object, i.e.

Marshal.dump(myobj, $defout)

is much faster for large dumps than Marshal to a string and then writing the
string.

Marshalling in seems to be very fast indeed.

Regards,

Brian.

···

On Wed, Mar 19, 2003 at 12:40:56AM +0900, Xiangrong Fang wrote:

Thanks. For the purpose of my current program, I don’t need
interoperable serialization. I think ruby’s is ok for me, however, I
don’see very good performance in 1.6.7’s Marshal, so I continue to use
sysread and split to build my hash in memory.