From: Roger Pack Date: 2009-11-04T04:50:49+09:00 Subject: [ruby-core:26505] [Bug #1332] Reading file on Windows is 500x slower then with previous Ruby version Issue #1332 has been updated by Roger Pack. I believe this is related to other issues regarding reading files in non-binary mode being slow in 1.9 >> a = File.open('l', 'w'); 10000000.times { a.write "abc\n" }; a.close >> Benchmark.measure { a = File.open('l', 'r'); a.readlines; a.close }.real => 11.890625 >> Benchmark.measure { a = File.open('l', 'rb'); a.readlines; a.close }.real => 3.59375 I believe that it is doing a string conversion from one encoding ["\r\n"] to another ["\n"]. Perhaps there is a way to speed this up? (ex: special case it somehow)? -r refs: http://www.ruby-forum.com/topic/182691 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/24824 ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1332 ---------------------------------------- http://redmine.ruby-lang.org