YAML::Store - fast read, slow write

B

Bill Kelly

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
 
M

Mauricio Fernández

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top