YAML::Store - fast read, slow write

Hi,

I have a 635K YAML file I'm using as a flat file database
with YAML::Store. It's taking about 13 seconds to do a
#transaction on the file - but I was surprised to see that
the file is loaded in 1 second, and that it takes 12 seconds
to write the file back out.

I installed syck-0.55 in case that might help, but the
timing seems about the same. (Dunno exactly which syck
version I had installed previously - it's whatever was
built with stock 1.8.2.)

Anyway I was wondering if the slow write speed was a known
issue / expected behavior? I'm running it with -rprofile,
but it's still going... <grin> I'll check the results of
that when I get up tomorrow....

Regards,

Bill

I have a 635K YAML file I'm using as a flat file database
with YAML::Store. It's taking about 13 seconds to do a
#transaction on the file - but I was surprised to see that
the file is loaded in 1 second, and that it takes 12 seconds
to write the file back out.

[...]

Anyway I was wondering if the slow write speed was a known
issue / expected behavior? I'm running it with -rprofile,
but it's still going... <grin> I'll check the results of
that when I get up tomorrow....

syck's emitter is known to be slow.

PS: it doesn't really help you in this case, but next
time you want to profile something, take a look at
http://raa.ruby-lang.org/project/ruby-prof/ which is massively faster
than the set_trace_func-based one.

ยทยทยท

On Thu, Jul 21, 2005 at 04:45:22PM +0900, Bill Kelly wrote:

--
Mauricio Fernandez