From: Roger Pack Date: 2010-03-05T04:33:28+09:00 Subject: [ruby-core:28483] Re: [Feature #905] Add String.new(fixnum) to preallocate large buffer > Doesn't Ruby allocate already using a "double memory if you run out" > rule? That makes string concatenation (amortized) linear, even if the > string must be moved in the memory. It doesn't when you're reading IO. Causing some serious slowdowns in doze. http://redmine.ruby-lang.org/issues/show/2742 http://redmine.ruby-lang.org/issues/show/2741 So the idea is sound. I almost surprised it isn't there already. A better name might be set_size or set_buffer -rp