Project

General

Profile

Feature #5875

Couple of tiny changes to string

Added by funny_falcon (Yura Sokolov) over 8 years ago. Updated over 8 years ago.

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

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

Updated by kosaki (Motohiro KOSAKI) over 8 years ago

  • Status changed from Open to Closed

Closed by reporter's request.

Also available in: Atom PDF