From: William James Date: 2007-05-04T12:20:07+09:00 Subject: Re: Beyond YAML? (scaling) On May 3, 10:11 am, Bil Kleb wrote: > Bil Kleb wrote: > > khai...@enigo.com wrote: > > >> I guess that depends on whether you need the files to be easily > >> readable or not. If you don't, Marshal will be faster than YAML. > > > At this point, I'm looking for an easy out that will > > reduce size and increase speed, and I'm willing to > > go binary if necessary. > > > Of the answers I've seen so far (thanks everyone!), > > migrating to Marshal seems to be the Simplest Thing > > That Could Possibly Work. > > Well, maybe not so simple... > > `dump': can't dump hash with default proc (TypeError) > > which seems to be due to the trick I learned from zenspider > and drbrain to quickly setup a hash of arrays:, > > Hash.new{ |hash,key| hash[key]=[] } > > Later, > -- > Bil Klebhttp://fun3d.larc.nasa.gov Would making a copy of the hash use too much memory or time? h=Hash.new{ |hash,key| hash[key]=[] } h['foo'] << 44 h['foo'] << 88 h_copy = {} h.each{|k,v| h_copy[k] = v} p h_copy