From: Motohiro KOSAKI Date: 2010-03-07T18:38:15+09:00 Subject: [ruby-core:28544] [Feature #905] Add String.new(fixnum) to preallocate large buffer Issue #905 has been updated by Motohiro KOSAKI. Hi At least, Linux madvise doesn't improve the performance in such case. current cruby + linux(glibc) realloc implementation makes very optimal behavior. a big size string makes a big size realloc() and a big size realloc() is using mremap(2) internally. Then, realloc() doesn't makes string copy at all. IOW, the main benefit of string.buffer() is to reduce realloc() cost. but it is already zero. so I don't think it is worth method. sadly almost developers never use such no improve method, I expect. Instead, I would propose improve JRuby's internal string representation and string concat implementation. Thanks. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/905 ---------------------------------------- http://redmine.ruby-lang.org