Feature #5875

Couple of tiny changes to string

Added by Yura Sokolov over 3 years ago. Updated over 3 years ago.

[ruby-core:42036]
Status:Closed
Priority:Normal
Assignee:-

Description

  • change capacity increment from (capa + 1) * 2 to capa * 2 + 1 previous increment formula leads to inconvenient allocation patterns: 25bytes, 51bytes, etc new formula leads to more comfortable allocation pattern: 24b, 48b, 96b
  • change STR_BUF_MIN_SIZE from 128 to 79 128 leads to allocation of 129 bytes, which is very uncomfortable for allocators and unnecessary large. (during Redmine startup this method is called about 3000000 times with capa < 128)

https://github.com/ruby/ruby/pull/80
https://github.com/funny-falcon/ruby/commit/2240a04d49118d9fa6f038655dac27f0ad96ed6b.patch

History

#1 Updated by Motohiro KOSAKI over 3 years ago

  • Status changed from Open to Closed

Closed by reporter's request.

Also available in: Atom PDF