il Thu, 11 Dec 2003 01:23:56 GMT, Steven Lumos <slumos / yahoo.com> ha scritto:: > >I have a (really) big data structure, which looks like: > > Features = [ > ["feature", ["parent1", "parent2"], {:C1 => [0.0, (7 more)], :C2 => ...}], > ...a LOT more (like 2500) lines... > ] > >I was initially using (shudder) XML for storage, but as the structure >developed, we literally had to choose between dumping XML or dumping >Ruby. I thought about other generic methods but ended up settling on >writing out the Ruby representation of the structure and loading it >with require. What I'm currently using is exactly like the above but >with the constant wrapped in a module. > >My question is: Is there an even faster way to load a big structure >than this? I suppose load should be little faster than require :) BTW, you may like to take a look at [ruby-talk: 83802], _why did some experiment on loadin stuff faster using yaml, over xml, with some tricks More: are you working with REXML? have you tried using libxml bindings? What about the ruby version/platform? 1.6 on windows was really slow, 1.8 is much faster.