Skip to content

Change String growth to resize by 1.625x instead of 2x#88973

Merged
Catfish-Man merged 2 commits intomainfrom
fools-golden-ratio
May 9, 2026
Merged

Change String growth to resize by 1.625x instead of 2x#88973
Catfish-Man merged 2 commits intomainfrom
fools-golden-ratio

Conversation

@Catfish-Man
Copy link
Copy Markdown
Contributor

@Catfish-Man Catfish-Man commented May 8, 2026

Fixes rdar://59684914

@Catfish-Man Catfish-Man self-assigned this May 8, 2026
@Catfish-Man Catfish-Man requested a review from a team as a code owner May 8, 2026 21:11
@Catfish-Man
Copy link
Copy Markdown
Contributor Author

@swift-ci please benchmark

Comment thread stdlib/public/core/StringGutsRangeReplaceable.swift Outdated
@Catfish-Man
Copy link
Copy Markdown
Contributor Author

WOO! That did the trick! No more magazine_malloc perf cliff.

16:43:51  ------- Performance (x86_64): -O -------
16:43:51  
16:43:51  REGRESSION                                    OLD       NEW        DELTA    RATIO    
16:43:51  UTF8Decode_InitFromData                       143.75    173.5      +20.7%   **0.83x (?)**
16:43:51  UTF8Decode_InitFromBytes                      162.5     194.0      +19.4%   **0.84x (?)**
16:43:51  StringComparison_ascii                        198.909   225.556    +13.4%   **0.88x (?)**
16:43:51  StringSwitch                                  275.143   310.833    +13.0%   **0.89x (?)**
16:43:51  SortStrings                                   482.75    531.5      +10.1%   **0.91x (?)**
16:43:51  Calculator                                    159.333   174.182    +9.3%    **0.91x (?)**
16:43:51  Breadcrumbs.CopyUTF16CodeUnits.Mixed          45.171    49.05      +8.6%    **0.92x (?)**
16:43:51  
16:43:51  IMPROVEMENT                                   OLD       NEW        DELTA    RATIO    
16:43:51  EqualStringSubstring                          29.6      22.038     -25.5%   **1.34x (?)**
16:43:51  Breadcrumbs.CopyAllUTF16CodeUnits.Mixed       203.545   153.0      -24.8%   **1.33x**
16:43:51  Breadcrumbs.CopyUTF16CodeUnits.longMixed      206.364   156.333    -24.2%   **1.32x (?)**
16:43:51  Breadcrumbs.CopyAllUTF16CodeUnits.longMixed   201.333   152.688    -24.2%   **1.32x**
16:43:51  EqualSubstringString                          29.719    22.604     -23.9%   **1.31x (?)**
16:43:51  Data.hash.Medium                              38.074    30.097     -21.0%   **1.27x (?)**
16:43:51  LessSubstringSubstring                        30.5      24.875     -18.4%   **1.23x (?)**
16:43:51  LessSubstringSubstringGenericComparable       30.483    25.029     -17.9%   **1.22x (?)**
16:43:51  EqualSubstringSubstringGenericEquatable       30.714    25.25      -17.8%   **1.22x (?)**
16:43:51  EqualSubstringSubstring                       30.04     25.34      -15.6%   **1.19x (?)**
16:43:51  StringDistance.utf16.ascii                    144.938   122.684    -15.4%   **1.18x (?)**
16:43:51  StringHashing_nonBMPSlowestPrenormal          500.256   431.395    -13.8%   **1.16x (?)**
16:43:51  NSString.bridged.byteCount.ascii.ascii        0.49      0.423      -13.6%   **1.16x (?)**
16:43:51  StringComparison_longSharedPrefix             228.091   205.0      -10.1%   **1.11x (?)**
16:43:51  SubstringEqualString                          158.636   142.727    -10.0%   **1.11x (?)**
16:43:51  StringHashing_emoji                           387.5     349.231    -9.9%    **1.11x (?)**
16:43:51  SubstringEquatable                            305.5     275.429    -9.8%    **1.11x (?)**
16:43:51  SubstringFromLongStringGeneric2               29.625    26.721     -9.8%    **1.11x (?)**
16:43:51  StringHashing_slowerPrenormal                 331.5     303.571    -8.4%    **1.09x (?)**
16:43:51  StringHasPrefixAscii                          2455.0    2251.111   -8.3%    **1.09x (?)**
16:43:51  StringHasSuffixUnicode                        52120.0   48000.0    -7.9%    **1.09x (?)**
16:43:51  SortStringsUnicode                            2330.0    2149.0     -7.8%    **1.08x (?)**
16:43:51  ObjectiveCBridgeStringHash                    63.552    59.032     -7.1%    **1.08x (?)**
16:43:51  StringHashing_latin1                          196.19    182.385    -7.0%    **1.08x (?)**
16:43:51  UTF8Decode_InitFromCustom_contiguous_ascii    176.643   164.917    -6.6%    **1.07x (?)**

@Catfish-Man
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@Catfish-Man Catfish-Man enabled auto-merge (squash) May 9, 2026 07:02
@Catfish-Man
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@Catfish-Man Catfish-Man merged commit ed3eec2 into main May 9, 2026
5 of 6 checks passed
@Catfish-Man Catfish-Man deleted the fools-golden-ratio branch May 9, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants