Skip to content

Conversation

milseman
Copy link
Member

@milseman milseman commented Feb 25, 2019

pitch thread

SE-0248

  • 8 simple APIs on Unicode’s various encodings
  • 2 generic initializers for string indices and ranges of indices
  • Substring.base, equivalent to Slice.base
  • Make Character.UTF8View and Character.UTF16View public
  • Add Unicode.Scalar.UTF8View

@milseman
Copy link
Member Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
FlattenListLoop 3561 3888 +9.2% 0.92x
Array2D 6208 6736 +8.5% 0.92x (?)
LessSubstringSubstring 36 39 +8.3% 0.92x (?)
EqualStringSubstring 36 39 +8.3% 0.92x (?)
EqualSubstringSubstringGenericEquatable 36 39 +8.3% 0.92x (?)
EqualSubstringString 36 39 +8.3% 0.92x (?)
LessSubstringSubstringGenericComparable 36 39 +8.3% 0.92x (?)
MapReduce 330 356 +7.9% 0.93x (?)
MapReduceAnyCollection 331 357 +7.9% 0.93x (?)
StringToDataEmpty 650 700 +7.7% 0.93x (?)

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
CharacterLiteralsLarge 89 100 +12.4% 0.89x
Set.isDisjoint.Box.Empty 170 187 +10.0% 0.91x (?)
Set.isSubset.Empty.Int 148 162 +9.5% 0.91x (?)
RemoveWhereFilterInts 38 41 +7.9% 0.93x (?)

Performance: -Onone

TEST OLD NEW DELTA RATIO
Improvement
StringBuilderWithLongSubstring 3140 2690 -14.3% 1.17x (?)
StringEdits 190500 169700 -10.9% 1.12x (?)
StrComplexWalk 6570 5920 -9.9% 1.11x
WordCountUniqueUTF16 11940 11110 -7.0% 1.07x (?)
WordCountUniqueASCII 11560 10770 -6.8% 1.07x (?)
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 8-Core Intel Xeon E5
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 25 MB
  Memory: 64 GB

@milseman milseman force-pushed the gab_barg branch 2 times, most recently from f25110b to c18703d Compare February 27, 2019 19:33
@milseman
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c18703d97609368c5da1b84cecd9e0e5a91f51a5

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c18703d97609368c5da1b84cecd9e0e5a91f51a5

@milseman milseman changed the title [WIP DO NOT MERGE]: String Grab Bag [WIP Awaiting Review]: String Grab Bag Feb 28, 2019
@milseman
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c18703d97609368c5da1b84cecd9e0e5a91f51a5

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c18703d97609368c5da1b84cecd9e0e5a91f51a5

@milseman
Copy link
Member Author

What?

/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/llvm/tools/clang/lib/DirectoryWatcher/DirectoryWatcher-linux.inc.h:95:23: error: use of undeclared identifier 'RetryAfterSignal'

@milseman milseman force-pushed the gab_barg branch 2 times, most recently from a0f6a31 to 3b4fce9 Compare March 5, 2019 00:42
@tkremenek tkremenek added the swift evolution approved Flag → feature: A feature that was approved through the Swift evolution process label Mar 22, 2019
@tkremenek
Copy link
Member

The evolution proposal for this change has been accepted.

@tkremenek
Copy link
Member

@swift-ci clean test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3b4fce9d346cd75631418a6653ef80c5a3020b8c

@tkremenek
Copy link
Member

@swift-ci clean test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3b4fce9d346cd75631418a6653ef80c5a3020b8c

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3b4fce9d346cd75631418a6653ef80c5a3020b8c

@milseman
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3b4fce9d346cd75631418a6653ef80c5a3020b8c

@airspeedswift
Copy link
Member

/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/swift/test/stdlib/StringIndex.swift:205:8: error: no such module 'Foundation'

😕

@milseman
Copy link
Member Author

Ah, so it seems we need to guard any of that functionality

This adds new (availability-controlled) API to Unicode.Scalar,
exposing the scalar's UTF-8 code units as a random-access collection
similarly to how it currently exposes UTF-16 code units.

Tests added.
Add convenience APIs to the stdlib's Unicode encodings:

* Unicode.UTF16
  * isASCII
  * isSurrogate
* Unicode.UTF8
  * isASCII
  * width
* Unicode.UTF32
  * isASCII
* Unicode.ASCII
  * isASCII

Tests added
Adds a generic version of String.Index.init?(_:within:) and
Range<String.Index>.init?(_:in:).

Tests added
Adds these collections, which are just String's views.

Tests added.
Adds Substring.base, analogous to Slice.base, to access the entire
String.

Tests added.
Bounds check the given index for String.Index's generic initializer
that makes sure a passed index is a valid one for the given
StringProtocol.
@milseman
Copy link
Member Author

milseman commented Apr 1, 2019

@swift-ci please test

@milseman milseman changed the title [WIP Awaiting Review]: String Grab Bag String Grab Bag Apr 1, 2019
@swift-ci
Copy link
Contributor

swift-ci commented Apr 1, 2019

Build failed
Swift Test Linux Platform
Git Sha - 3b4fce9d346cd75631418a6653ef80c5a3020b8c

@swift-ci
Copy link
Contributor

swift-ci commented Apr 1, 2019

Build failed
Swift Test OS X Platform
Git Sha - 3b4fce9d346cd75631418a6653ef80c5a3020b8c

@milseman milseman changed the title String Grab Bag [SE-0248] String Gaps Apr 1, 2019
@milseman
Copy link
Member Author

milseman commented Apr 1, 2019

@swift-ci please test OS X platform

@swift-ci
Copy link
Contributor

swift-ci commented Apr 1, 2019

Build failed
Swift Test OS X Platform
Git Sha - c36daeb

@milseman
Copy link
Member Author

milseman commented Apr 2, 2019

Jenkins crashed.

@swift-ci please test OS X platform

@milseman milseman merged commit ff39c34 into swiftlang:master Apr 2, 2019
@AnthonyLatsis AnthonyLatsis added swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented and removed swift evolution approved Flag → feature: A feature that was approved through the Swift evolution process labels Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants