Skip to content

[SR-9184] UTF-8 String Regressions #51675

Open
Open
@milseman

Description

@milseman
mannequin
Previous ID SR-9184
Radar None
Original Reporter @milseman
Type Task

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Task, Performance
Assignee @milseman
Priority Medium

md5: 5e76fa6a2d0620628262e8b5de6feea2

Sub-Tasks:

  • SR-9192 Flatten/rework normalized code unit iterator
  • SR-9212 String comparison binary-divergence fast-path not triggering
  • SR-9270 Tweak String comparison inlinability
  • SR-9272 Potential invalid benchmarks (used to skip allocations)
  • SR-9287 Poor codegen for String iteration
  • SR-9427 CharacterLiteralsSmall: Failure to constant-fold release

Issue Description:

UTF-8 String comes a lot of wins, but some current regressions:

regressions.md

This is an ☂️ bug, see Sub-Tasks below.

Current status of this set of regressions. Note this is only a listing of what were regressions when the PR was merged; omitted benchmarks exhibited improvement:

  • 5.0 currently has parity with 4.2 performance:

    • StringFromLongWholeSubstringGeneric

    • StringComparison_fastPrenormal

    • WordCountUniqueASCII

    • RemoveWhereQuadraticString

    • StringWordBuilder

    • StringHashing_ascii

  • 5.0 is faster than 4.2:

    • SubstringComparble

    • StringFromLongWholeSubstring

    • StringComparison_latin1

    • StringWalk

    • StringEqualPointerComparison

    • Dictionary3

    • StringWordBuilderReservingCapacity

    • StringHasPrefixUnicode

    • Dictionary

    • RemoveWhereFilterString

    • StringInterpolationManySmallSegments

    • StringMatch

    • Join

    • StringBuilderLong

    • RomanNumbers

  • Resolved for Swift 5.0:

    • Chars2: We're happy with the size/speed tradeoff

      • While still slower than 4.2, this is now is significantly smaller in code size (~7x smaller)

Every single one of these extracted and merged into a single script file normalized to around 1 second each: https://gist.github.com/milseman/737d74fd4a6817432b3b5f18c34d416d

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions