[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby Hash/Array to_yaml is slow

Shin guey Wong

5/3/2008 5:58:00 AM

I try to convert a ruby array(contains hash and array) to yaml and it
takes 60 seconds to perform the job and it consumes a lot of memory and
full cpu usage(almost 100%). The ruby object is very big and it will
produce 80000+ lines of yaml file. The speed is not acceptable for me.
So, instead of using the to_yaml function I created my own conversion
function just do print string for the hash and the array and now it only
take 2 seconds.(I did some changes like use inner hash to reduce the
yaml lines count, now it only produce 40000 lines) I am not sure the
alogrithm of the yaml but could it be a bug for the ruby yaml?
--
Posted via http://www.ruby-....

1 Answer

Ryan Davis

5/3/2008 8:12:00 PM

0


On May 2, 2008, at 22:57 , Shin guey Wong wrote:

> I am not sure the
> alogrithm of the yaml but could it be a bug for the ruby yaml?

if it is, this isn't the right forum to report it. File a bug on
_why's trac.

Alternatively, use Marshal.