[#76442] [Ruby trunk Feature#11741] Migrate Ruby to Git from Subversion — naruse@...
Issue #11741 has been updated by Yui NARUSE.
3 messages
2016/07/19
[#76515] [Ruby trunk Bug#12610] webrick: protect from httpoxy — nagachika00@...
Issue #12610 has been updated by Tomoyuki Chikanaga.
3 messages
2016/07/22
[ruby-core:76567] [Ruby trunk Feature#905][Closed] Add String.new(fixnum) to preallocate large buffer
From:
shyouhei@...
Date:
2016-07-26 07:33:58 UTC
List:
ruby-core #76567
Issue #905 has been updated by Shyouhei Urabe. Status changed from Feedback to Closed Closing. Please use String.new with capacity. ---------------------------------------- Feature #905: Add String.new(fixnum) to preallocate large buffer https://bugs.ruby-lang.org/issues/905#change-59795 * Author: Charles Nutter * Status: Closed * Priority: Normal * Assignee: Yukihiro Matsumoto ---------------------------------------- =begin Because Strings are used in ruby as arbitrary byte buffers, and because the cost of growing a String increases as it gets larger (especially when it starts small), String.new should support a form that takes a fixnum and ensures the backing store will have at least that much room. This is analogous to Array.new(fixnum) which does the same thing. The simple implementation of this would just add a Fixnum check to the String.new method, and the result would be an empty string with that size buffer. This would allow heavy string-appending algorithms and libraries (like ERb) to avoid doing so many memory copies while they run. =end ---Files-------------------------------- string_buffer.diff (846 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>