Help me with a strange bug: IO#read became extremely slow

hi,

i am trying to find out why my program went so slow, but i can t find
out why IO#read is the bottleneck.
here is the profiler output:

% cumulative self self total
time seconds seconds calls ms/call ms/call name
98.52 19.29 19.29 107 180.26 180.26 IO#read

(AMD 1800+ reading 110 files from system, 192 kb each, on win32 )
19.29 that cant be!! should be not more than 3 seconds in worst case.
it was that fast before i played around, but i can t think of something
i did wrong.
the problem is maybe not in my program code, because i isolated the
loading routine and its still that slow.

i am reading in the files like this:
if FileTest.exist? filename
f = File.new filename
f.binmode
data = f.read
end

rebooting the computer didn t help, there is enough memory …
… i really don t understand what s going on.

maybe one of you can open my eyes, or maybe one of you happened to
experience a similar case.
thanks for help, Meinrad

Hi,

···

In message “help me with a strange bug: IO#read became extremely slow” on 03/03/08, Meinrad Recheis meinrad.recheis@aon.at writes:

i am trying to find out why my program went so slow, but i can t find
out why IO#read is the bottleneck.

Tell us the version and platform information from ruby -v, e.g.

ruby 1.6.8 (2002-12-24) [i386-cygwin]

						matz.

here it is:
ruby 1.6.8 (2002-12-24) [i586-mswin32]

-meinrad

“Yukihiro Matsumoto” matz@ruby-lang.org wrote in message
news:1047082651.649394.22915.nullmailer@picachu.netlab.jp…

···

Hi,

In message “help me with a strange bug: IO#read became extremely slow” > on 03/03/08, Meinrad Recheis meinrad.recheis@aon.at writes:

i am trying to find out why my program went so slow, but i can t find
out why IO#read is the bottleneck.

Tell us the version and platform information from ruby -v, e.g.

ruby 1.6.8 (2002-12-24) [i386-cygwin]

matz.