Roger Pack wrote: > >> ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32] >> "2 40.188834" >> >> ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] >> "2 0.087" >> >> That is about 5x slower write and 500x read operation. Times are the >> same if I do: >> f = File.new('out.file','r') >> c = f.read >> f.close >> P.S. >> Where can I officaly report a Ruby bug? > > Looks like this bug is http://redmine.ruby-lang.org/issues/show/1332 > Can you try with mode 'rb' and is it fast then? > -r Also this one is much much slower on ruby 1.9 then on ruby 1.8: Tested on Windows XP. No virus scanner. time = [Time.new] n = 1000 lines = [] (1..n).each { |nr| lines << "line" } time << Time.new File.open('out2.file','w') { |f| lines.each { |l| f.print(l) f.flush } } time << Time.new txt = ['construct','write','read'] 0.upto(time.size - 2) {|i| p "#{txt[i]} #{time[i+1]-time[i]}" } #ruby 1.9 #"construct 0.0" #"write 22.453125" #ruby 1.8 #"construct 0.0" #"write 0.015" -- Posted via http://www.ruby-forum.com/.