Project

General

Profile

Actions

Backport #2722

closed

gets on a large file takes a very very long time

Added by ghazel (Greg Hazel) almost 15 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
[ruby-core:28103]

Description

=begin
This problem occurs on 1.8.6, 1.8.7 and 1.9.1 (all the versions I tested)

This simple script demonstrates the problem:

100 MB

n = 100 * 1000 * 1000
puts "writing"
File.open("foo", 'wb'){|f| f.write(" " * n) }
puts "reading"
File.open("foo", 'rb') do |io|
io.gets
end

This takes about 1911 seconds. Using a 10MB file completes in 19 seconds, instead of in 1/10th the time as you would imagine. Similarly a 1MB file completes in 0.18 seconds.
=end


Related issues 1 (0 open1 closed)

Related to Backport187 - Backport #2741: gets with large file is slow in windozeClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0