close
Skip to content

[stdlib] Unicode 9 and Thread Local Storage#9265

Merged
milseman merged 9 commits intoswiftlang:masterfrom
milseman:tls_ftw
May 11, 2017
Merged

[stdlib] Unicode 9 and Thread Local Storage#9265
milseman merged 9 commits intoswiftlang:masterfrom
milseman:tls_ftw

Conversation

@milseman
Copy link
Copy Markdown
Member

@milseman milseman commented May 4, 2017

TL;DR Add support for Unicode 9 grapheme breaking (i.e. emoji) by using ICU. Work around ICU efficiency issues with thread-local storage.


Introduce shims for using UBreakIterators from ICU. Also introduce
shims for using thread local storage via pthreads.

We will be relying on ICU and UBreakIterators for grapheme
breaking. But, UBreakIterators are very expensive to create,
especially for the way we do grapheme breaking, which is relatively
stateless. Thus, we will stash one or more into thread local storage
and reset it as needed.


Introduces a _ThreadLocalStorage struct to hold thread-local, but
global resources. Set it up to host a UBreakIterator and a cache key
for resetting text.

UBreakIterators are extremely expensive to create on the fly, so we
store one for each thread. UBreakIterators are also expensive to bind
to new text, so we cache the text it's currently bound to in order to
help avoid it.

The struct can be expanded with more functionality in the future, but
the standard library should only ever use a single key, and thus
everything should go on this struct. The _ThreadLocalStorage struct is
not meant to be copyable, creatable (by anyone else except the
once-per-thread initialize routine), and should accessed through the
pointers it provides.

Future immediate directions could include cashing multiple
UBreakIterators (e.g. avoid a text reset for mutual character
iteration patterns, etc).

Test added in test/stdlib/ThreadLocalStorage.swift.


Use UBreakIterators to perform grapheme breaking. This gives Unicode 9
grapheme breaking (e.g. family emoji) and provides a means to upgrade
to future versions. It also serves as a model for how to serve up
other advanced functionality in ICU to users.

This has tricky performance implications. Some things are faster and a
number of cases are slower. But, careful use of ICU can help mitigate
and amortize these costs. In conjunction with more early detection of
fast paths, overall grapheme breaking for the average user should be
much faster than in Swift 3.

NOTE: This is incomplete. It currently falls back on the legacy tries
for some bridged strings. There are many potential directions for a
general solution, but for now we'll be interatively adding support for
more and more special cases.

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 4, 2017

@swift-ci please test

Not just for kicks, I'm genuinely interested

Comment thread stdlib/public/core/CMakeLists.txt Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @compnerd mentioned, we can remove the "-l" part

@airspeedswift
Copy link
Copy Markdown
Member

@swift-ci please test

@airspeedswift
Copy link
Copy Markdown
Member

@swift-ci please smoke benchmark

@swift-ci
Copy link
Copy Markdown
Contributor

swift-ci commented May 4, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 7e780409b176834bdfb51c469b441b16521c057b
Test requested by - @airspeedswift

@swift-ci
Copy link
Copy Markdown
Contributor

swift-ci commented May 4, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 7e780409b176834bdfb51c469b441b16521c057b
Test requested by - @airspeedswift

@swift-ci
Copy link
Copy Markdown
Contributor

swift-ci commented May 4, 2017

Build comment file:

Optimized (O)

Regression (24)
TEST OLD NEW DELTA SPEEDUP
StringWithCString 113553 312045 +174.8% 0.36x
CStringLongAscii 4745 12908 +172.0% 0.37x
CharacterLiteralsSmall 300 734 +144.7% 0.41x
CStringLongNonAscii 2016 3984 +97.6% 0.51x
ObjectiveCBridgeToNSDictionary 44200 58987 +33.5% 0.75x
CharacterLiteralsLarge 8131 9992 +22.9% 0.81x
SuperChars 290766 342862 +17.9% 0.85x
StringMatch 8757 10177 +16.2% 0.86x
CStringShortAscii 4958 5735 +15.7% 0.86x
OpenClose 45 51 +13.3% 0.88x
DropFirstAnySequenceLazy 6373 7203 +13.0% 0.88x
Array2D 1994 2240 +12.3% 0.89x (?)
MapReduceAnyCollection 286 313 +9.4% 0.91x
MapReduce 284 310 +9.2% 0.92x
DropFirstAnySequence 6420 6901 +7.5% 0.93x
ArrayAppendUTF16 38446 41303 +7.4% 0.93x
DictionaryBridge 2586 2774 +7.3% 0.93x
MapReduceLazyCollection 14 15 +7.1% 0.93x
StackPromo 21118 22561 +6.8% 0.94x
UTF8Decode 244 259 +6.1% 0.94x
PrefixAnySequenceLazy 5766 6094 +5.7% 0.95x
PrefixAnySequence 5767 6093 +5.7% 0.95x
StringHasSuffix 647 683 +5.6% 0.95x (?)
RangeAssignment 289 305 +5.5% 0.95x
Improvement (10)
TEST OLD NEW DELTA SPEEDUP
MapReduceString 105 67 -36.2% 1.57x
Chars 1735 1313 -24.3% 1.32x
StringEdits 420910 327528 -22.2% 1.29x
MapReduceShortString 20 17 -15.0% 1.18x (?)
ArrayAppendAscii 21746 18816 -13.5% 1.16x
DropWhileArrayLazy 84 75 -10.7% 1.12x
ProtocolDispatch 2861 2574 -10.0% 1.11x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5211 4704 -9.7% 1.11x
Calculator 44 41 -6.8% 1.07x
StringHasPrefix 615 575 -6.5% 1.07x
No Changes (235)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 2731 2759 +1.0% 0.99x
AnyHashableWithAClass 63178 64013 +1.3% 0.99x
ArrayAppend 731 732 +0.1% 1.00x (?)
ArrayAppendArrayOfInt 563 564 +0.2% 1.00x (?)
ArrayAppendFromGeneric 563 563 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1137 +0.1% 1.00x (?)
ArrayAppendLatin1 41183 43230 +5.0% 0.95x
ArrayAppendLazyMap 883 884 +0.1% 1.00x (?)
ArrayAppendOptionals 1135 1138 +0.3% 1.00x
ArrayAppendRepeatCol 790 791 +0.1% 1.00x
ArrayAppendReserved 504 503 -0.2% 1.00x
ArrayAppendSequence 895 894 -0.1% 1.00x (?)
ArrayAppendStrings 12758 12742 -0.1% 1.00x (?)
ArrayAppendToFromGeneric 563 564 +0.2% 1.00x
ArrayAppendToGeneric 563 563 +0.0% 1.00x
ArrayInClass 59 60 +1.7% 0.98x (?)
ArrayLiteral 1161 1169 +0.7% 0.99x (?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
ArrayOfGenericRef 3771 3798 +0.7% 0.99x (?)
ArrayOfPOD 156 156 +0.0% 1.00x
ArrayOfRef 3723 3708 -0.4% 1.00x (?)
ArrayPlusEqualArrayOfInt 563 563 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 4202 4195 -0.2% 1.00x
ArrayPlusEqualSingleElementCollection 731 731 +0.0% 1.00x
ArrayPlusEqualThreeElements 1504 1506 +0.1% 1.00x (?)
ArraySubscript 1404 1416 +0.9% 0.99x
ArrayValueProp 5 5 +0.0% 1.00x
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
ArrayValueProp4 5 5 +0.0% 1.00x
BitCount 0 0 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
CaptureProp 4364 4381 +0.4% 1.00x
ClassArrayGetter 13 13 +0.0% 1.00x
DeadArray 172 171 -0.6% 1.01x (?)
Dictionary 541 546 +0.9% 0.99x
Dictionary2 1702 1688 -0.8% 1.01x
Dictionary2OfObjects 3132 3127 -0.2% 1.00x (?)
Dictionary3 429 430 +0.2% 1.00x (?)
Dictionary3OfObjects 848 847 -0.1% 1.00x (?)
DictionaryLiteral 1395 1404 +0.6% 0.99x (?)
DictionaryOfObjects 2208 2213 +0.2% 1.00x (?)
DictionaryRemove 3091 3099 +0.3% 1.00x (?)
DictionaryRemoveOfObjects 22028 22088 +0.3% 1.00x
DictionarySwap 349 349 +0.0% 1.00x
DictionarySwapOfObjects 6594 6528 -1.0% 1.01x (?)
DropFirstAnyCollection 120 119 -0.8% 1.01x (?)
DropFirstAnyCollectionLazy 42471 42625 +0.4% 1.00x (?)
DropFirstAnySeqCRangeIter 26202 26506 +1.2% 0.99x
DropFirstAnySeqCRangeIterLazy 26194 26364 +0.6% 0.99x
DropFirstAnySeqCntRange 108 109 +0.9% 0.99x
DropFirstAnySeqCntRangeLazy 108 109 +0.9% 0.99x
DropFirstArray 27 27 +0.0% 1.00x
DropFirstArrayLazy 31 31 +0.0% 1.00x
DropFirstCountableRange 22 22 +0.0% 1.00x
DropFirstCountableRangeLazy 21 21 +0.0% 1.00x
DropFirstSequence 2894 2893 -0.0% 1.00x
DropFirstSequenceLazy 2857 2861 +0.1% 1.00x
DropLastAnyCollection 49 49 +0.0% 1.00x
DropLastAnyCollectionLazy 14137 14131 -0.0% 1.00x (?)
DropLastAnySeqCRangeIter 4390 4369 -0.5% 1.00x
DropLastAnySeqCRangeIterLazy 4399 4368 -0.7% 1.01x
DropLastAnySeqCntRange 38 38 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 38 38 +0.0% 1.00x
DropLastAnySequence 6260 6377 +1.9% 0.98x
DropLastAnySequenceLazy 6167 6169 +0.0% 1.00x (?)
DropLastArray 10 10 +0.0% 1.00x
DropLastArrayLazy 10 10 +0.0% 1.00x
DropLastCountableRange 8 8 +0.0% 1.00x
DropLastCountableRangeLazy 8 8 +0.0% 1.00x
DropLastSequence 488 487 -0.2% 1.00x
DropLastSequenceLazy 486 487 +0.2% 1.00x (?)
DropWhileAnyCollection 126 127 +0.8% 0.99x
DropWhileAnyCollectionLazy 90 91 +1.1% 0.99x
DropWhileAnySeqCRangeIter 20885 21661 +3.7% 0.96x
DropWhileAnySeqCRangeIterLazy 90 91 +1.1% 0.99x
DropWhileAnySeqCntRange 121 121 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 90 90 +0.0% 1.00x
DropWhileAnySequence 7196 7165 -0.4% 1.00x
DropWhileAnySequenceLazy 1989 1989 +0.0% 1.00x
DropWhileArray 44 44 +0.0% 1.00x
DropWhileCountableRange 33 33 +0.0% 1.00x
DropWhileCountableRangeLazy 75 75 +0.0% 1.00x
DropWhileSequence 2920 2948 +1.0% 0.99x
DropWhileSequenceLazy 72 72 +0.0% 1.00x
ErrorHandling 2762 2799 +1.3% 0.99x (?)
GlobalClass 0 0 +0.0% 1.00x
Hanoi 3256 3283 +0.8% 0.99x
HashQuadratic 5692377 5707976 +0.3% 1.00x
HashTest 1617 1631 +0.9% 0.99x
Histogram 232 235 +1.3% 0.99x
Integrate 247 247 +0.0% 1.00x
IterateData 718 721 +0.4% 1.00x
Join 414 419 +1.2% 0.99x
LazilyFilteredArrays 61897 61937 +0.1% 1.00x (?)
LazilyFilteredRange 3888 3777 -2.9% 1.03x (?)
LinkedList 6728 6765 +0.5% 0.99x
MapReduceAnyCollectionShort 1890 1896 +0.3% 1.00x
MapReduceClass 2900 2882 -0.6% 1.01x
MapReduceClassShort 4350 4269 -1.9% 1.02x
MapReduceLazyCollectionShort 42 43 +2.4% 0.98x
MapReduceLazySequence 85 85 +0.0% 1.00x
MapReduceSequence 434 444 +2.3% 0.98x
MapReduceShort 1781 1819 +2.1% 0.98x
Memset 221 221 +0.0% 1.00x
MonteCarloE 9789 9768 -0.2% 1.00x
MonteCarloPi 41618 41474 -0.3% 1.00x
NSDictionaryCastToSwift 5037 5100 +1.3% 0.99x (?)
NSError 272 272 +0.0% 1.00x
NSStringConversion 703 732 +4.1% 0.96x
NopDeinit 27326 27482 +0.6% 0.99x
ObjectAllocation 169 177 +4.7% 0.95x
ObjectiveCBridgeFromNSArrayAnyObject 22521 22203 -1.4% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4239 4235 -0.1% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 41173 41949 +1.9% 0.98x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 35406 35625 +0.6% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 111447 115690 +3.8% 0.96x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 89243 87303 -2.2% 1.02x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 87477 84756 -3.1% 1.03x (?)
ObjectiveCBridgeFromNSSetAnyObject 61394 61110 -0.5% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 3996 3912 -2.1% 1.02x
ObjectiveCBridgeFromNSSetAnyObjectToString 67594 69723 +3.1% 0.97x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 58807 60309 +2.6% 0.98x
ObjectiveCBridgeFromNSString 1349 1339 -0.7% 1.01x
ObjectiveCBridgeFromNSStringForced 2243 2211 -1.4% 1.01x
ObjectiveCBridgeStubDataAppend 3527 3549 +0.6% 0.99x (?)
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 27378 27135 -0.9% 1.01x (?)
ObjectiveCBridgeStubFromNSDate 3466 3492 +0.8% 0.99x
ObjectiveCBridgeStubFromNSDateRef 3428 3439 +0.3% 1.00x
ObjectiveCBridgeStubFromNSString 875 896 +2.4% 0.98x
ObjectiveCBridgeStubFromNSStringRef 171 169 -1.2% 1.01x
ObjectiveCBridgeStubNSDataAppend 2192 2140 -2.4% 1.02x (?)
ObjectiveCBridgeStubNSDateMutationRef 11836 12058 +1.9% 0.98x (?)
ObjectiveCBridgeStubNSDateRefAccess 330 324 -1.8% 1.02x (?)
ObjectiveCBridgeStubToArrayOfNSString 27359 27455 +0.4% 1.00x (?)
ObjectiveCBridgeStubToNSDate 14303 13702 -4.2% 1.04x (?)
ObjectiveCBridgeStubToNSDateRef 3222 3200 -0.7% 1.01x (?)
ObjectiveCBridgeStubToNSString 1436 1422 -1.0% 1.01x
ObjectiveCBridgeStubToNSStringRef 102 103 +1.0% 0.99x
ObjectiveCBridgeStubURLAppendPath 215616 212775 -1.3% 1.01x (?)
ObjectiveCBridgeStubURLAppendPathRef 217934 218451 +0.2% 1.00x (?)
ObjectiveCBridgeToNSArray 27306 27704 +1.5% 0.99x (?)
ObjectiveCBridgeToNSSet 37885 38418 +1.4% 0.99x (?)
ObjectiveCBridgeToNSString 1199 1198 -0.1% 1.00x
ObserverClosure 2154 2177 +1.1% 0.99x
ObserverForwarderStruct 1057 1051 -0.6% 1.01x (?)
ObserverPartiallyAppliedMethod 3598 3619 +0.6% 0.99x
ObserverUnappliedMethod 2559 2589 +1.2% 0.99x (?)
Phonebook 8972 9120 +1.6% 0.98x
PolymorphicCalls 20 20 +0.0% 1.00x
PopFrontArray 1016 1012 -0.4% 1.00x (?)
PopFrontArrayGeneric 1012 1012 +0.0% 1.00x
PopFrontUnsafePointer 8384 8395 +0.1% 1.00x
PrefixAnyCollection 120 119 -0.8% 1.01x
PrefixAnyCollectionLazy 42325 42616 +0.7% 0.99x (?)
PrefixAnySeqCRangeIter 20418 20910 +2.4% 0.98x (?)
PrefixAnySeqCRangeIterLazy 20567 20634 +0.3% 1.00x
PrefixAnySeqCntRange 109 109 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 109 109 +0.0% 1.00x
PrefixArray 28 28 +0.0% 1.00x
PrefixArrayLazy 28 27 -3.6% 1.04x
PrefixCountableRange 22 22 +0.0% 1.00x
PrefixCountableRangeLazy 22 22 +0.0% 1.00x
PrefixSequence 2489 2418 -2.9% 1.03x
PrefixSequenceLazy 2453 2455 +0.1% 1.00x
PrefixWhileAnyCollection 151 151 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 73 73 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 11808 11820 +0.1% 1.00x
PrefixWhileAnySeqCRangeIterLazy 73 73 +0.0% 1.00x
PrefixWhileAnySeqCntRange 146 146 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 73 73 +0.0% 1.00x
PrefixWhileAnySequence 13337 13362 +0.2% 1.00x
PrefixWhileAnySequenceLazy 1498 1498 +0.0% 1.00x
PrefixWhileArray 62 63 +1.6% 0.98x
PrefixWhileArrayLazy 54 54 +0.0% 1.00x
PrefixWhileCountableRange 34 33 -2.9% 1.03x
PrefixWhileCountableRangeLazy 22 22 +0.0% 1.00x
PrefixWhileSequence 364 380 +4.4% 0.96x
PrefixWhileSequenceLazy 36 36 +0.0% 1.00x
Prims 745 719 -3.5% 1.04x
ProtocolDispatch2 160 160 +0.0% 1.00x
RC4 159 161 +1.3% 0.99x
RGBHistogram 2169 2136 -1.5% 1.02x (?)
RGBHistogramOfObjects 23102 22800 -1.3% 1.01x
RecursiveOwnedParameter 2196 2183 -0.6% 1.01x
ReversedArray 48 46 -4.2% 1.04x (?)
ReversedBidirectional 27518 27509 -0.0% 1.00x (?)
ReversedDictionary 95 95 +0.0% 1.00x
SetExclusiveOr 2799 2785 -0.5% 1.01x (?)
SetExclusiveOr_OfObjects 9092 9080 -0.1% 1.00x (?)
SetIntersect 257 259 +0.8% 0.99x (?)
SetIntersect_OfObjects 1632 1633 +0.1% 1.00x (?)
SetIsSubsetOf 270 270 +0.0% 1.00x
SetIsSubsetOf_OfObjects 338 338 +0.0% 1.00x
SetUnion 2495 2507 +0.5% 1.00x (?)
SetUnion_OfObjects 7687 7596 -1.2% 1.01x
SevenBoom 1381 1381 +0.0% 1.00x
Sim2DArray 261 260 -0.4% 1.00x
SortLargeExistentials 7839 7911 +0.9% 0.99x
SortLettersInPlace 1080 1087 +0.6% 0.99x
SortSortedStrings 812 804 -1.0% 1.01x
SortStrings 1570 1578 +0.5% 0.99x
SortStringsUnicode 7472 7311 -2.2% 1.02x
StaticArray 20 20 +0.0% 1.00x
StrComplexWalk 930 932 +0.2% 1.00x (?)
StrToInt 4127 4210 +2.0% 0.98x (?)
StringAdder 0 0 +0.0% 1.00x
StringBuilder 1218 1254 +3.0% 0.97x
StringBuilderLong 890 867 -2.6% 1.03x
StringEqualPointerComparison 6874 6927 +0.8% 0.99x (?)
StringHasPrefixUnicode 13628 13658 +0.2% 1.00x (?)
StringHasSuffixUnicode 58016 57827 -0.3% 1.00x (?)
StringInterpolation 7829 7851 +0.3% 1.00x (?)
StringUTF16Builder 1988 1984 -0.2% 1.00x (?)
StringWalk 5819 5744 -1.3% 1.01x
SuffixAnyCollection 49 49 +0.0% 1.00x
SuffixAnyCollectionLazy 14202 14227 +0.2% 1.00x (?)
SuffixAnySeqCRangeIter 4649 4671 +0.5% 1.00x
SuffixAnySeqCRangeIterLazy 4697 4668 -0.6% 1.01x
SuffixAnySeqCntRange 38 37 -2.6% 1.03x
SuffixAnySeqCntRangeLazy 38 37 -2.6% 1.03x
SuffixAnySequence 6314 6374 +1.0% 0.99x
SuffixAnySequenceLazy 6189 6178 -0.2% 1.00x (?)
SuffixArray 10 10 +0.0% 1.00x
SuffixArrayLazy 10 10 +0.0% 1.00x
SuffixCountableRange 8 8 +0.0% 1.00x
SuffixCountableRangeLazy 8 8 +0.0% 1.00x
SuffixSequence 4198 4227 +0.7% 0.99x
SuffixSequenceLazy 4199 4226 +0.6% 0.99x
TwoSum 882 859 -2.6% 1.03x (?)
TypeFlood 0 0 +0.0% 1.00x
Walsh 337 331 -1.8% 1.02x
XorLoop 328 328 +0.0% 1.00x
**Unoptimized (Onone)**
Regression (15)
TEST OLD NEW DELTA SPEEDUP
StringWithCString 119049 309235 +159.8% 0.38x
CStringLongAscii 5145 12228 +137.7% 0.42x
CStringLongNonAscii 2269 3977 +75.3% 0.57x
DictionaryLiteral 7800 12474 +59.9% 0.63x
StrToInt 4962 7610 +53.4% 0.65x
ArrayAppendAscii 58477 79706 +36.3% 0.73x
ObjectiveCBridgeToNSDictionary 43930 57816 +31.6% 0.76x
ArrayAppendLatin1 79939 98876 +23.7% 0.81x
ArrayAppendUTF16 79382 97906 +23.3% 0.81x
OpenClose 384 443 +15.4% 0.87x
CharacterLiteralsLarge 9256 10395 +12.3% 0.89x
SuperChars 323114 361004 +11.7% 0.90x
CStringShortAscii 7807 8566 +9.7% 0.91x
DictionaryBridge 2681 2849 +6.3% 0.94x
TypeFlood 147 156 +6.1% 0.94x (?)
Improvement (7)
TEST OLD NEW DELTA SPEEDUP
StringEdits 697506 586870 -15.9% 1.19x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7479 6841 -8.5% 1.09x (?)
ObjectiveCBridgeStubFromNSDate 3895 3584 -8.0% 1.09x
ArrayAppendReserved 3682 3390 -7.9% 1.09x
Calculator 967 910 -5.9% 1.06x
ArrayOfGenericPOD 3232 3070 -5.0% 1.05x
ObjectiveCBridgeStubDataAppend 3684 3503 -4.9% 1.05x
No Changes (247)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 2957 2945 -0.4% 1.00x
AnyHashableWithAClass 79776 79417 -0.5% 1.00x (?)
Array2D 574039 573936 -0.0% 1.00x (?)
ArrayAppend 3475 3386 -2.6% 1.03x
ArrayAppendArrayOfInt 616 616 +0.0% 1.00x
ArrayAppendFromGeneric 621 620 -0.2% 1.00x (?)
ArrayAppendGenericStructs 1197 1197 +0.0% 1.00x
ArrayAppendLazyMap 195846 201208 +2.7% 0.97x
ArrayAppendOptionals 1197 1196 -0.1% 1.00x (?)
ArrayAppendRepeatCol 201032 200825 -0.1% 1.00x
ArrayAppendSequence 71604 70391 -1.7% 1.02x
ArrayAppendStrings 12828 12811 -0.1% 1.00x (?)
ArrayAppendToFromGeneric 619 617 -0.3% 1.00x
ArrayAppendToGeneric 620 618 -0.3% 1.00x
ArrayInClass 4471 4482 +0.2% 1.00x (?)
ArrayLiteral 1414 1393 -1.5% 1.02x
ArrayOfGenericRef 9048 9042 -0.1% 1.00x (?)
ArrayOfPOD 1785 1786 +0.1% 1.00x (?)
ArrayOfRef 8355 8319 -0.4% 1.00x (?)
ArrayPlusEqualArrayOfInt 616 615 -0.2% 1.00x (?)
ArrayPlusEqualFiveElementCollection 275111 277462 +0.9% 0.99x (?)
ArrayPlusEqualSingleElementCollection 274250 271619 -1.0% 1.01x (?)
ArrayPlusEqualThreeElements 9762 9710 -0.5% 1.01x (?)
ArraySubscript 3932 4042 +2.8% 0.97x
ArrayValueProp 2823 2824 +0.0% 1.00x (?)
ArrayValueProp2 3421 3428 +0.2% 1.00x (?)
ArrayValueProp3 3220 3226 +0.2% 1.00x (?)
ArrayValueProp4 3142 3152 +0.3% 1.00x (?)
BitCount 829 832 +0.4% 1.00x
ByteSwap 251 250 -0.4% 1.00x (?)
CaptureProp 103616 101638 -1.9% 1.02x
CharacterLiteralsSmall 943 916 -2.9% 1.03x
Chars 6994 7050 +0.8% 0.99x (?)
ClassArrayGetter 869 870 +0.1% 1.00x
DeadArray 108840 110622 +1.6% 0.98x (?)
Dictionary 1596 1602 +0.4% 1.00x (?)
Dictionary2 3264 3277 +0.4% 1.00x (?)
Dictionary2OfObjects 5449 5499 +0.9% 0.99x (?)
Dictionary3 1246 1247 +0.1% 1.00x (?)
Dictionary3OfObjects 2087 2083 -0.2% 1.00x (?)
DictionaryOfObjects 4342 4367 +0.6% 0.99x (?)
DictionaryRemove 19877 19903 +0.1% 1.00x (?)
DictionaryRemoveOfObjects 52591 52173 -0.8% 1.01x
DictionarySwap 5152 5168 +0.3% 1.00x
DictionarySwapOfObjects 18484 18397 -0.5% 1.00x (?)
DropFirstAnyCollection 18134 18907 +4.3% 0.96x
DropFirstAnyCollectionLazy 128579 131623 +2.4% 0.98x
DropFirstAnySeqCRangeIter 28197 28994 +2.8% 0.97x
DropFirstAnySeqCRangeIterLazy 28080 28932 +3.0% 0.97x
DropFirstAnySeqCntRange 18074 18995 +5.1% 0.95x
DropFirstAnySeqCntRangeLazy 18141 18867 +4.0% 0.96x
DropFirstAnySequence 13335 13444 +0.8% 0.99x
DropFirstAnySequenceLazy 13464 13447 -0.1% 1.00x (?)
DropFirstArray 5851 5857 +0.1% 1.00x
DropFirstArrayLazy 42543 42619 +0.2% 1.00x (?)
DropFirstCountableRange 320 320 +0.0% 1.00x
DropFirstCountableRangeLazy 36422 36755 +0.9% 0.99x
DropFirstSequence 12304 12699 +3.2% 0.97x
DropFirstSequenceLazy 12207 12294 +0.7% 0.99x
DropLastAnyCollection 6076 6348 +4.5% 0.96x
DropLastAnyCollectionLazy 43608 44823 +2.8% 0.97x
DropLastAnySeqCRangeIter 41066 41997 +2.3% 0.98x
DropLastAnySeqCRangeIterLazy 41604 42324 +1.7% 0.98x
DropLastAnySeqCntRange 6082 6334 +4.1% 0.96x
DropLastAnySeqCntRangeLazy 6048 6291 +4.0% 0.96x
DropLastAnySequence 27446 27591 +0.5% 0.99x (?)
DropLastAnySequenceLazy 27471 27786 +1.1% 0.99x
DropLastArray 1956 1973 +0.9% 0.99x
DropLastArrayLazy 14190 14221 +0.2% 1.00x (?)
DropLastCountableRange 113 112 -0.9% 1.01x
DropLastCountableRangeLazy 12341 12236 -0.9% 1.01x (?)
DropLastSequence 27000 27162 +0.6% 0.99x
DropLastSequenceLazy 27240 27092 -0.5% 1.01x
DropWhileAnyCollection 23559 24510 +4.0% 0.96x
DropWhileAnyCollectionLazy 25525 26695 +4.6% 0.96x
DropWhileAnySeqCRangeIter 30182 30947 +2.5% 0.98x
DropWhileAnySeqCRangeIterLazy 25785 26615 +3.2% 0.97x (?)
DropWhileAnySeqCntRange 23717 24472 +3.2% 0.97x
DropWhileAnySeqCntRangeLazy 25575 26746 +4.6% 0.96x
DropWhileAnySequence 15117 15164 +0.3% 1.00x (?)
DropWhileAnySequenceLazy 11694 11692 -0.0% 1.00x (?)
DropWhileArray 9234 9248 +0.2% 1.00x (?)
DropWhileArrayLazy 15962 15961 -0.0% 1.00x (?)
DropWhileCountableRange 5787 5874 +1.5% 0.99x
DropWhileCountableRangeLazy 24642 25645 +4.1% 0.96x
DropWhileSequence 14104 14189 +0.6% 0.99x (?)
DropWhileSequenceLazy 10648 10562 -0.8% 1.01x (?)
ErrorHandling 3553 3649 +2.7% 0.97x (?)
GlobalClass 0 0 +0.0% 1.00x
Hanoi 16756 16392 -2.2% 1.02x
HashQuadratic 49577652 47427538 -4.3% 1.05x
HashTest 17585 17527 -0.3% 1.00x (?)
Histogram 8287 8302 +0.2% 1.00x (?)
Integrate 376 376 +0.0% 1.00x
IterateData 12197 12139 -0.5% 1.00x
Join 1193 1192 -0.1% 1.00x (?)
LazilyFilteredArrays 1601885 1601129 -0.0% 1.00x (?)
LazilyFilteredRange 637433 663526 +4.1% 0.96x (?)
LinkedList 31274 31272 -0.0% 1.00x (?)
MapReduce 35653 35815 +0.5% 1.00x
MapReduceAnyCollection 35630 35704 +0.2% 1.00x (?)
MapReduceAnyCollectionShort 47198 47923 +1.5% 0.98x
MapReduceClass 40934 40754 -0.4% 1.00x
MapReduceClassShort 51670 51243 -0.8% 1.01x
MapReduceLazyCollection 32598 33077 +1.5% 0.99x
MapReduceLazyCollectionShort 41591 41977 +0.9% 0.99x
MapReduceLazySequence 24642 24965 +1.3% 0.99x
MapReduceSequence 39312 38705 -1.5% 1.02x
MapReduceShort 47075 47170 +0.2% 1.00x (?)
MapReduceShortString 265 260 -1.9% 1.02x (?)
MapReduceString 2450 2442 -0.3% 1.00x
Memset 41516 41520 +0.0% 1.00x (?)
MonteCarloE 127537 128312 +0.6% 0.99x
MonteCarloPi 50141 49574 -1.1% 1.01x
NSDictionaryCastToSwift 6156 6000 -2.5% 1.03x
NSError 680 678 -0.3% 1.00x (?)
NSStringConversion 1240 1289 +4.0% 0.96x
NopDeinit 47530 48897 +2.9% 0.97x
ObjectAllocation 601 601 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 23596 24148 +2.3% 0.98x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7438 7326 -1.5% 1.02x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 41881 43019 +2.7% 0.97x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 36706 36961 +0.7% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 114938 119217 +3.7% 0.96x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 95924 91374 -4.7% 1.05x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 90507 91720 +1.3% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObject 64226 63941 -0.4% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 6934 6700 -3.4% 1.03x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 71193 72516 +1.9% 0.98x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 62200 62892 +1.1% 0.99x (?)
ObjectiveCBridgeFromNSString 3783 3849 +1.7% 0.98x (?)
ObjectiveCBridgeFromNSStringForced 2599 2573 -1.0% 1.01x
ObjectiveCBridgeStubDateAccess 972 953 -2.0% 1.02x
ObjectiveCBridgeStubDateMutation 488 489 +0.2% 1.00x (?)
ObjectiveCBridgeStubFromArrayOfNSString 27408 27354 -0.2% 1.00x (?)
ObjectiveCBridgeStubFromNSDateRef 3724 3640 -2.3% 1.02x
ObjectiveCBridgeStubFromNSString 927 937 +1.1% 0.99x (?)
ObjectiveCBridgeStubFromNSStringRef 205 196 -4.4% 1.05x
ObjectiveCBridgeStubNSDataAppend 2514 2489 -1.0% 1.01x (?)
ObjectiveCBridgeStubNSDateMutationRef 14986 15088 +0.7% 0.99x (?)
ObjectiveCBridgeStubNSDateRefAccess 1152 1152 +0.0% 1.00x
ObjectiveCBridgeStubToArrayOfNSString 27652 26819 -3.0% 1.03x
ObjectiveCBridgeStubToNSDate 15048 14583 -3.1% 1.03x
ObjectiveCBridgeStubToNSDateRef 3186 3200 +0.4% 1.00x (?)
ObjectiveCBridgeStubToNSString 1482 1479 -0.2% 1.00x
ObjectiveCBridgeStubToNSStringRef 147 147 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 221925 213016 -4.0% 1.04x (?)
ObjectiveCBridgeStubURLAppendPathRef 216260 222317 +2.8% 0.97x
ObjectiveCBridgeToNSArray 27783 27630 -0.6% 1.01x (?)
ObjectiveCBridgeToNSSet 38230 37504 -1.9% 1.02x (?)
ObjectiveCBridgeToNSString 1243 1236 -0.6% 1.01x
ObserverClosure 6519 6533 +0.2% 1.00x (?)
ObserverForwarderStruct 4737 4755 +0.4% 1.00x
ObserverPartiallyAppliedMethod 7858 7858 +0.0% 1.00x
ObserverUnappliedMethod 7997 7968 -0.4% 1.00x (?)
Phonebook 23534 23147 -1.6% 1.02x (?)
PolymorphicCalls 2753 2777 +0.9% 0.99x
PopFrontArray 9225 9326 +1.1% 0.99x
PopFrontArrayGeneric 8228 8220 -0.1% 1.00x (?)
PopFrontUnsafePointer 91754 92727 +1.1% 0.99x
PrefixAnyCollection 18143 18950 +4.4% 0.96x
PrefixAnyCollectionLazy 128769 132293 +2.7% 0.97x
PrefixAnySeqCRangeIter 22775 23304 +2.3% 0.98x (?)
PrefixAnySeqCRangeIterLazy 22758 23376 +2.7% 0.97x
PrefixAnySeqCntRange 18081 18988 +5.0% 0.95x
PrefixAnySeqCntRangeLazy 18149 18734 +3.2% 0.97x
PrefixAnySequence 11201 11489 +2.6% 0.97x
PrefixAnySequenceLazy 11277 11262 -0.1% 1.00x
PrefixArray 5887 5844 -0.7% 1.01x
PrefixArrayLazy 42527 42631 +0.2% 1.00x
PrefixCountableRange 323 321 -0.6% 1.01x
PrefixCountableRangeLazy 36394 36880 +1.3% 0.99x (?)
PrefixSequence 10162 10495 +3.3% 0.97x
PrefixSequenceLazy 10156 10260 +1.0% 0.99x
PrefixWhileAnyCollection 34579 35492 +2.6% 0.97x
PrefixWhileAnyCollectionLazy 21230 21746 +2.4% 0.98x
PrefixWhileAnySeqCRangeIter 38415 39066 +1.7% 0.98x
PrefixWhileAnySeqCRangeIterLazy 21312 21748 +2.0% 0.98x
PrefixWhileAnySeqCntRange 34740 35546 +2.3% 0.98x
PrefixWhileAnySeqCntRangeLazy 21137 21830 +3.3% 0.97x
PrefixWhileAnySequence 28259 28393 +0.5% 1.00x
PrefixWhileAnySequenceLazy 10605 10946 +3.2% 0.97x
PrefixWhileArray 15896 15887 -0.1% 1.00x (?)
PrefixWhileArrayLazy 13890 13883 -0.1% 1.00x (?)
PrefixWhileCountableRange 16647 16862 +1.3% 0.99x
PrefixWhileCountableRangeLazy 20514 21073 +2.7% 0.97x
PrefixWhileSequence 26736 26831 +0.4% 1.00x (?)
PrefixWhileSequenceLazy 9871 9810 -0.6% 1.01x
Prims 8542 8440 -1.2% 1.01x
ProtocolDispatch 6556 6557 +0.0% 1.00x (?)
ProtocolDispatch2 462 463 +0.2% 1.00x
RC4 18334 18307 -0.1% 1.00x (?)
RGBHistogram 32157 32400 +0.8% 0.99x (?)
RGBHistogramOfObjects 93335 93095 -0.3% 1.00x
RangeAssignment 5453 5459 +0.1% 1.00x (?)
RecursiveOwnedParameter 9099 9121 +0.2% 1.00x (?)
ReversedArray 558 557 -0.2% 1.00x (?)
ReversedBidirectional 71571 70279 -1.8% 1.02x
ReversedDictionary 24412 24426 +0.1% 1.00x (?)
SetExclusiveOr 20121 19889 -1.2% 1.01x
SetExclusiveOr_OfObjects 39152 38918 -0.6% 1.01x
SetIntersect 10166 10069 -1.0% 1.01x
SetIntersect_OfObjects 10543 10615 +0.7% 0.99x (?)
SetIsSubsetOf 1525 1539 +0.9% 0.99x
SetIsSubsetOf_OfObjects 1480 1434 -3.1% 1.03x
SetUnion 11469 11301 -1.5% 1.01x
SetUnion_OfObjects 27985 28000 +0.1% 1.00x (?)
SevenBoom 1521 1508 -0.9% 1.01x
Sim2DArray 28854 28870 +0.1% 1.00x (?)
SortLargeExistentials 16904 16855 -0.3% 1.00x
SortLettersInPlace 2696 2705 +0.3% 1.00x (?)
SortSortedStrings 1341 1341 +0.0% 1.00x
SortStrings 2376 2367 -0.4% 1.00x (?)
SortStringsUnicode 8490 8389 -1.2% 1.01x
StackPromo 97285 96791 -0.5% 1.01x (?)
StaticArray 4318 4322 +0.1% 1.00x (?)
StrComplexWalk 5656 5656 +0.0% 1.00x
StringAdder 42 42 +0.0% 1.00x
StringBuilder 2599 2673 +2.8% 0.97x
StringBuilderLong 1046 1024 -2.1% 1.02x
StringEqualPointerComparison 9374 9229 -1.5% 1.02x
StringHasPrefix 1612 1659 +2.9% 0.97x
StringHasPrefixUnicode 15659 15417 -1.5% 1.02x
StringHasSuffix 1699 1746 +2.8% 0.97x
StringHasSuffixUnicode 60050 60083 +0.1% 1.00x (?)
StringInterpolation 11246 11210 -0.3% 1.00x (?)
StringMatch 28868 29112 +0.8% 0.99x
StringUTF16Builder 3410 3461 +1.5% 0.99x (?)
StringWalk 21230 20395 -3.9% 1.04x
SuffixAnyCollection 6055 6319 +4.4% 0.96x
SuffixAnyCollectionLazy 42835 44385 +3.6% 0.97x
SuffixAnySeqCRangeIter 39449 39880 +1.1% 0.99x
SuffixAnySeqCRangeIterLazy 39374 40092 +1.8% 0.98x (?)
SuffixAnySeqCntRange 6087 6325 +3.9% 0.96x
SuffixAnySeqCntRangeLazy 6039 6282 +4.0% 0.96x
SuffixAnySequence 25225 25509 +1.1% 0.99x
SuffixAnySequenceLazy 25537 25822 +1.1% 0.99x
SuffixArray 1954 1967 +0.7% 0.99x
SuffixArrayLazy 14200 14224 +0.2% 1.00x (?)
SuffixCountableRange 112 112 +0.0% 1.00x
SuffixCountableRangeLazy 12160 12495 +2.8% 0.97x
SuffixSequence 24919 24993 +0.3% 1.00x
SuffixSequenceLazy 25465 24976 -1.9% 1.02x
TwoSum 4132 4085 -1.1% 1.01x (?)
UTF8Decode 35331 35313 -0.1% 1.00x
Walsh 11257 11197 -0.5% 1.01x
XorLoop 22386 22385 -0.0% 1.00x (?)
**Hardware Overview** Model Name: Mac mini Model Identifier: Macmini7,1 Processor Name: Intel Core i7 Processor Speed: 3 GHz Number of Processors: 1 Total Number of Cores: 2 L2 Cache (per Core): 256 KB L3 Cache: 4 MB Memory: 16 GB

@airspeedswift
Copy link
Copy Markdown
Member

I think those benchmarks are showing changes on master from other things that went in since, like the new utf8 decoding and the change to remove <, not this change. Needs rebasing and rebenchmarking.

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 8, 2017

@swift-ci please test

@swift-ci
Copy link
Copy Markdown
Contributor

swift-ci commented May 8, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 7e780409b176834bdfb51c469b441b16521c057b
Test requested by - @milseman

@swift-ci
Copy link
Copy Markdown
Contributor

swift-ci commented May 8, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 7e780409b176834bdfb51c469b441b16521c057b
Test requested by - @milseman

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

Rewrote history a little to squash some things, and only pull in the tiny bits of ICU that we use.

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

Added in more static protections for cross-platform differences and a cache coherency fix.

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

@swift-ci please smoke test Linux platform

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

@swift-ci please smoke benchmark

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

I extracted some of those smoke benchmarks, and I'm seeing us being way faster with this PR compared to a couple weeks ago (before a lot of my other optimizations). I'm measuring that we are:
StringWithCString: 5x faster
CStringLongAscii: 2.5x faster
CStringLongNonAscii: 2x faster

than a couple weeks ago.

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

/home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test/branch-master/swift/lib/ClangImporter/ClangImporter.cpp:2647:41: error: too few arguments to function call, single argument 'Diags' was not specified
  return Impl.Invocation->getModuleHash();
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

looks like the builder's broken, as other PRs are hitting this. Will try again soon.

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

@swift-ci please smoke test Linux platform

@CodaFi
Copy link
Copy Markdown
Contributor

CodaFi commented May 9, 2017

Just for bookkeeping: This supersedes #3125, right?

@milseman
Copy link
Copy Markdown
Member Author

milseman commented May 9, 2017

@CodaFi when it lands, yes

@swift-ci
Copy link
Copy Markdown
Contributor

Build comment file:

Optimized (O)

Regression (2)
TEST OLD NEW DELTA SPEEDUP
SuperChars 295672 352351 +19.2% 0.84x
StringHasPrefixUnicode 14168 14965 +5.6% 0.95x
Improvement (2)
TEST OLD NEW DELTA SPEEDUP
ClassArrayGetter 14 13 -7.1% 1.08x
SetExclusiveOr_OfObjects 10240 9570 -6.5% 1.07x
No Changes (265)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 2918 2912 -0.2% 1.00x (?)
AnyHashableWithAClass 68414 66420 -2.9% 1.03x
Array2D 2024 2030 +0.3% 1.00x
ArrayAppend 772 772 +0.0% 1.00x
ArrayAppendArrayOfInt 597 597 +0.0% 1.00x
ArrayAppendAscii 22131 22851 +3.3% 0.97x
ArrayAppendFromGeneric 596 596 +0.0% 1.00x
ArrayAppendGenericStructs 1228 1227 -0.1% 1.00x (?)
ArrayAppendLatin1 43418 43361 -0.1% 1.00x
ArrayAppendLazyMap 937 936 -0.1% 1.00x (?)
ArrayAppendOptionals 1214 1247 +2.7% 0.97x (?)
ArrayAppendRepeatCol 838 838 +0.0% 1.00x
ArrayAppendReserved 533 532 -0.2% 1.00x
ArrayAppendSequence 945 945 +0.0% 1.00x
ArrayAppendStrings 13630 13666 +0.3% 1.00x (?)
ArrayAppendToFromGeneric 596 597 +0.2% 1.00x
ArrayAppendToGeneric 597 596 -0.2% 1.00x
ArrayAppendUTF16 41815 41317 -1.2% 1.01x (?)
ArrayInClass 61 62 +1.6% 0.98x (?)
ArrayLiteral 1220 1218 -0.2% 1.00x (?)
ArrayOfGenericPOD 219 219 +0.0% 1.00x
ArrayOfGenericRef 3993 4010 +0.4% 1.00x (?)
ArrayOfPOD 166 166 +0.0% 1.00x
ArrayOfRef 3923 3909 -0.4% 1.00x (?)
ArrayPlusEqualArrayOfInt 597 597 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 4697 4656 -0.9% 1.01x
ArrayPlusEqualSingleElementCollection 771 771 +0.0% 1.00x
ArrayPlusEqualThreeElements 1594 1591 -0.2% 1.00x
ArraySubscript 1474 1487 +0.9% 0.99x
ArrayValueProp 6 6 +0.0% 1.00x
ArrayValueProp2 6 6 +0.0% 1.00x
ArrayValueProp3 6 6 +0.0% 1.00x
ArrayValueProp4 6 6 +0.0% 1.00x
BitCount 9 9 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
CStringLongAscii 5000 5019 +0.4% 1.00x (?)
CStringLongNonAscii 2168 2163 -0.2% 1.00x (?)
CStringShortAscii 5286 5290 +0.1% 1.00x (?)
Calculator 33 33 +0.0% 1.00x
CaptureProp 4564 4564 +0.0% 1.00x
CharacterLiteralsLarge 8672 8640 -0.4% 1.00x (?)
CharacterLiteralsSmall 310 314 +1.3% 0.99x
Chars 1839 1839 +0.0% 1.00x
DeadArray 184 184 +0.0% 1.00x
Dictionary 574 573 -0.2% 1.00x (?)
Dictionary2 1804 1820 +0.9% 0.99x
Dictionary2OfObjects 3338 3326 -0.4% 1.00x (?)
Dictionary3 455 455 +0.0% 1.00x
Dictionary3OfObjects 898 900 +0.2% 1.00x (?)
DictionaryBridge 2627 2641 +0.5% 0.99x (?)
DictionaryLiteral 1478 1479 +0.1% 1.00x (?)
DictionaryOfObjects 2346 2342 -0.2% 1.00x (?)
DictionaryRemove 3304 3314 +0.3% 1.00x
DictionaryRemoveOfObjects 23457 23595 +0.6% 0.99x
DictionarySwap 382 382 +0.0% 1.00x
DictionarySwapOfObjects 6950 6944 -0.1% 1.00x (?)
DropFirstAnyCollection 56 56 +0.0% 1.00x
DropFirstAnyCollectionLazy 45000 45089 +0.2% 1.00x
DropFirstAnySeqCRangeIter 27725 27993 +1.0% 0.99x
DropFirstAnySeqCRangeIterLazy 27665 27888 +0.8% 0.99x
DropFirstAnySeqCntRange 51 50 -2.0% 1.02x
DropFirstAnySeqCntRangeLazy 50 50 +0.0% 1.00x
DropFirstAnySequence 7209 7207 -0.0% 1.00x (?)
DropFirstAnySequenceLazy 7078 7201 +1.7% 0.98x
DropFirstArray 24 24 +0.0% 1.00x
DropFirstArrayLazy 24 24 +0.0% 1.00x
DropFirstCountableRange 32 32 +0.0% 1.00x
DropFirstCountableRangeLazy 32 32 +0.0% 1.00x
DropFirstSequence 3064 3064 +0.0% 1.00x
DropFirstSequenceLazy 3029 3030 +0.0% 1.00x (?)
DropLastAnyCollection 22 22 +0.0% 1.00x
DropLastAnyCollectionLazy 15047 15118 +0.5% 1.00x
DropLastAnySeqCRangeIter 4602 4599 -0.1% 1.00x
DropLastAnySeqCRangeIterLazy 4602 4600 -0.0% 1.00x (?)
DropLastAnySeqCntRange 16 16 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 16 16 +0.0% 1.00x
DropLastAnySequence 6656 6771 +1.7% 0.98x (?)
DropLastAnySequenceLazy 6523 6525 +0.0% 1.00x (?)
DropLastArray 8 8 +0.0% 1.00x
DropLastArrayLazy 8 8 +0.0% 1.00x
DropLastCountableRange 10 10 +0.0% 1.00x
DropLastCountableRangeLazy 10 10 +0.0% 1.00x
DropLastSequence 566 567 +0.2% 1.00x (?)
DropLastSequenceLazy 567 567 +0.0% 1.00x
DropWhileAnyCollection 70 70 +0.0% 1.00x
DropWhileAnyCollectionLazy 103 103 +0.0% 1.00x
DropWhileAnySeqCRangeIter 22213 22318 +0.5% 1.00x (?)
DropWhileAnySeqCRangeIterLazy 104 103 -1.0% 1.01x
DropWhileAnySeqCntRange 64 64 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 103 103 +0.0% 1.00x
DropWhileAnySequence 7750 7843 +1.2% 0.99x
DropWhileAnySequenceLazy 2032 2032 +0.0% 1.00x
DropWhileArray 37 37 +0.0% 1.00x
DropWhileArrayLazy 78 78 +0.0% 1.00x
DropWhileCountableRange 36 36 +0.0% 1.00x
DropWhileCountableRangeLazy 68 68 +0.0% 1.00x
DropWhileSequence 3117 3123 +0.2% 1.00x
DropWhileSequenceLazy 65 65 +0.0% 1.00x
ErrorHandling 2885 2871 -0.5% 1.00x (?)
GlobalClass 0 0 +0.0% 1.00x
Hanoi 3453 3424 -0.8% 1.01x
HashQuadratic 6053688 6040690 -0.2% 1.00x (?)
HashTest 1691 1691 +0.0% 1.00x
Histogram 249 249 +0.0% 1.00x
Integrate 262 262 +0.0% 1.00x
IterateData 758 757 -0.1% 1.00x (?)
Join 443 442 -0.2% 1.00x (?)
LazilyFilteredArrays 65034 64640 -0.6% 1.01x (?)
LazilyFilteredRange 3883 3891 +0.2% 1.00x (?)
LinkedList 7142 7142 +0.0% 1.00x
MapReduce 332 333 +0.3% 1.00x (?)
MapReduceAnyCollection 303 304 +0.3% 1.00x (?)
MapReduceAnyCollectionShort 2000 2005 +0.2% 1.00x (?)
MapReduceClass 3070 3071 +0.0% 1.00x
MapReduceClassShort 4581 4636 +1.2% 0.99x
MapReduceLazyCollection 15 15 +0.0% 1.00x
MapReduceLazyCollectionShort 45 45 +0.0% 1.00x
MapReduceLazySequence 90 90 +0.0% 1.00x
MapReduceSequence 445 447 +0.4% 1.00x (?)
MapReduceShort 1895 1901 +0.3% 1.00x
MapReduceShortString 21 21 +0.0% 1.00x
MapReduceString 109 109 +0.0% 1.00x
Memset 234 235 +0.4% 1.00x
MonteCarloE 10396 10400 +0.0% 1.00x (?)
MonteCarloPi 44046 44072 +0.1% 1.00x (?)
NSDictionaryCastToSwift 5455 5507 +1.0% 0.99x (?)
NSError 289 290 +0.3% 1.00x
NSStringConversion 760 768 +1.1% 0.99x
NopDeinit 27452 27460 +0.0% 1.00x (?)
ObjectAllocation 187 184 -1.6% 1.02x
ObjectiveCBridgeFromNSArrayAnyObject 24141 24022 -0.5% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4532 4515 -0.4% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToString 43343 43809 +1.1% 0.99x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 37840 38341 +1.3% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 117658 117423 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5140 5326 +3.6% 0.97x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 94705 96719 +2.1% 0.98x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 89063 92091 +3.4% 0.97x (?)
ObjectiveCBridgeFromNSSetAnyObject 64365 64646 +0.4% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4183 4204 +0.5% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 71172 71666 +0.7% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 62626 62694 +0.1% 1.00x (?)
ObjectiveCBridgeFromNSString 1435 1431 -0.3% 1.00x
ObjectiveCBridgeFromNSStringForced 2346 2376 +1.3% 0.99x
ObjectiveCBridgeStubDataAppend 3734 3672 -1.7% 1.02x
ObjectiveCBridgeStubDateAccess 182 182 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 272 272 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 28982 28578 -1.4% 1.01x (?)
ObjectiveCBridgeStubFromNSDate 3645 3643 -0.1% 1.00x (?)
ObjectiveCBridgeStubFromNSDateRef 3732 3730 -0.1% 1.00x (?)
ObjectiveCBridgeStubFromNSString 967 923 -4.6% 1.05x
ObjectiveCBridgeStubFromNSStringRef 176 176 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2394 2393 -0.0% 1.00x (?)
ObjectiveCBridgeStubNSDateMutationRef 12621 12859 +1.9% 0.98x (?)
ObjectiveCBridgeStubNSDateRefAccess 375 373 -0.5% 1.01x
ObjectiveCBridgeStubToArrayOfNSString 28703 29146 +1.5% 0.98x
ObjectiveCBridgeStubToNSDate 15215 15290 +0.5% 1.00x (?)
ObjectiveCBridgeStubToNSDateRef 3415 3419 +0.1% 1.00x (?)
ObjectiveCBridgeStubToNSString 1514 1519 +0.3% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 108 108 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 219188 217440 -0.8% 1.01x (?)
ObjectiveCBridgeStubURLAppendPathRef 218975 218616 -0.2% 1.00x (?)
ObjectiveCBridgeToNSArray 28894 29037 +0.5% 1.00x (?)
ObjectiveCBridgeToNSDictionary 45379 45882 +1.1% 0.99x (?)
ObjectiveCBridgeToNSSet 39104 39159 +0.1% 1.00x (?)
ObjectiveCBridgeToNSString 1271 1262 -0.7% 1.01x (?)
ObserverClosure 2292 2289 -0.1% 1.00x (?)
ObserverForwarderStruct 1137 1109 -2.5% 1.03x
ObserverPartiallyAppliedMethod 3815 3794 -0.6% 1.01x (?)
ObserverUnappliedMethod 2651 2651 +0.0% 1.00x
OpenClose 54 54 +0.0% 1.00x
Phonebook 9352 9345 -0.1% 1.00x (?)
PolymorphicCalls 22 22 +0.0% 1.00x
PopFrontArray 1076 1075 -0.1% 1.00x (?)
PopFrontArrayGeneric 1076 1075 -0.1% 1.00x (?)
PopFrontUnsafePointer 8858 8846 -0.1% 1.00x
PrefixAnyCollection 56 56 +0.0% 1.00x
PrefixAnyCollectionLazy 45143 45271 +0.3% 1.00x
PrefixAnySeqCRangeIter 21598 22069 +2.2% 0.98x
PrefixAnySeqCRangeIterLazy 21966 22065 +0.5% 1.00x
PrefixAnySeqCntRange 51 50 -2.0% 1.02x
PrefixAnySeqCntRangeLazy 50 50 +0.0% 1.00x
PrefixAnySequence 6182 6078 -1.7% 1.02x
PrefixAnySequenceLazy 6179 6075 -1.7% 1.02x
PrefixArray 24 24 +0.0% 1.00x
PrefixArrayLazy 25 25 +0.0% 1.00x
PrefixCountableRange 32 32 +0.0% 1.00x
PrefixCountableRangeLazy 32 32 +0.0% 1.00x
PrefixSequence 2658 2657 -0.0% 1.00x
PrefixSequenceLazy 2617 2617 +0.0% 1.00x
PrefixWhileAnyCollection 96 96 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 75 75 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 12506 12490 -0.1% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 75 75 +0.0% 1.00x
PrefixWhileAnySeqCntRange 90 90 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 75 75 +0.0% 1.00x
PrefixWhileAnySequence 14152 14160 +0.1% 1.00x (?)
PrefixWhileAnySequenceLazy 1492 1492 +0.0% 1.00x
PrefixWhileArray 62 62 +0.0% 1.00x
PrefixWhileArrayLazy 49 49 +0.0% 1.00x
PrefixWhileCountableRange 36 36 +0.0% 1.00x
PrefixWhileCountableRangeLazy 32 32 +0.0% 1.00x
PrefixWhileSequence 313 312 -0.3% 1.00x (?)
PrefixWhileSequenceLazy 28 28 +0.0% 1.00x
Prims 755 757 +0.3% 1.00x
ProtocolDispatch 2727 2728 +0.0% 1.00x (?)
ProtocolDispatch2 161 160 -0.6% 1.01x
RC4 159 160 +0.6% 0.99x
RGBHistogram 2265 2285 +0.9% 0.99x (?)
RGBHistogramOfObjects 24409 24445 +0.1% 1.00x (?)
RangeAssignment 296 304 +2.7% 0.97x (?)
RecursiveOwnedParameter 2330 2327 -0.1% 1.00x (?)
ReversedArray 49 50 +2.0% 0.98x (?)
ReversedBidirectional 29132 29106 -0.1% 1.00x (?)
ReversedDictionary 110 110 +0.0% 1.00x
SetExclusiveOr 2953 2949 -0.1% 1.00x (?)
SetIntersect 282 285 +1.1% 0.99x
SetIntersect_OfObjects 1723 1723 +0.0% 1.00x
SetIsSubsetOf 286 286 +0.0% 1.00x
SetIsSubsetOf_OfObjects 365 365 +0.0% 1.00x
SetUnion 2629 2641 +0.5% 1.00x (?)
SetUnion_OfObjects 8019 8010 -0.1% 1.00x (?)
SevenBoom 1464 1468 +0.3% 1.00x (?)
Sim2DArray 276 276 +0.0% 1.00x
SortLargeExistentials 8331 8302 -0.3% 1.00x
SortLettersInPlace 1147 1149 +0.2% 1.00x (?)
SortSortedStrings 835 833 -0.2% 1.00x (?)
SortStrings 1619 1605 -0.9% 1.01x
SortStringsUnicode 7759 7752 -0.1% 1.00x (?)
StackPromo 22180 22223 +0.2% 1.00x
StaticArray 21 21 +0.0% 1.00x
StrComplexWalk 720 720 +0.0% 1.00x
StrToInt 4143 4157 +0.3% 1.00x
StringAdder 0 0 +0.0% 1.00x
StringBuilder 1311 1322 +0.8% 0.99x
StringBuilderLong 902 919 +1.9% 0.98x
StringEdits 201233 200490 -0.4% 1.00x (?)
StringEqualPointerComparison 7403 7336 -0.9% 1.01x
StringHasPrefix 33 33 +0.0% 1.00x
StringHasSuffix 16 16 +0.0% 1.00x
StringHasSuffixUnicode 61819 61825 +0.0% 1.00x (?)
StringInterpolation 8336 8295 -0.5% 1.00x (?)
StringMatch 8939 8809 -1.5% 1.01x
StringUTF16Builder 2070 2103 +1.6% 0.98x
StringWalk 6352 6350 -0.0% 1.00x
StringWithCString 126300 125734 -0.4% 1.00x
SuffixAnyCollection 22 22 +0.0% 1.00x
SuffixAnyCollectionLazy 14994 15000 +0.0% 1.00x (?)
SuffixAnySeqCRangeIter 4928 4925 -0.1% 1.00x
SuffixAnySeqCRangeIterLazy 4929 4924 -0.1% 1.00x (?)
SuffixAnySeqCntRange 16 16 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 16 16 +0.0% 1.00x
SuffixAnySequence 6635 6637 +0.0% 1.00x (?)
SuffixAnySequenceLazy 6547 6547 +0.0% 1.00x
SuffixArray 8 8 +0.0% 1.00x
SuffixArrayLazy 8 8 +0.0% 1.00x
SuffixCountableRange 10 10 +0.0% 1.00x
SuffixCountableRangeLazy 11 11 +0.0% 1.00x
SuffixSequence 4469 4487 +0.4% 1.00x
SuffixSequenceLazy 4464 4463 -0.0% 1.00x (?)
TwoSum 872 873 +0.1% 1.00x (?)
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 257 257 +0.0% 1.00x
Walsh 356 356 +0.0% 1.00x
XorLoop 347 347 +0.0% 1.00x
**Unoptimized (Onone)**
Regression (2)
TEST OLD NEW DELTA SPEEDUP
SuperChars 315325 511423 +62.2% 0.62x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7310 7887 +7.9% 0.93x (?)
Improvement (1)
TEST OLD NEW DELTA SPEEDUP
ArrayAppendGenericStructs 1361 1283 -5.7% 1.06x
No Changes (266)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 3123 3121 -0.1% 1.00x (?)
AnyHashableWithAClass 84031 84044 +0.0% 1.00x (?)
Array2D 606494 608540 +0.3% 1.00x
ArrayAppend 3785 3784 -0.0% 1.00x (?)
ArrayAppendArrayOfInt 651 652 +0.2% 1.00x (?)
ArrayAppendAscii 60609 61509 +1.5% 0.99x (?)
ArrayAppendFromGeneric 655 654 -0.2% 1.00x (?)
ArrayAppendLatin1 82690 83793 +1.3% 0.99x
ArrayAppendLazyMap 208922 209854 +0.4% 1.00x
ArrayAppendOptionals 1312 1292 -1.5% 1.02x (?)
ArrayAppendRepeatCol 210615 212315 +0.8% 0.99x
ArrayAppendReserved 3429 3429 +0.0% 1.00x
ArrayAppendSequence 75242 74309 -1.2% 1.01x
ArrayAppendStrings 13704 13758 +0.4% 1.00x (?)
ArrayAppendToFromGeneric 653 654 +0.2% 1.00x (?)
ArrayAppendToGeneric 654 655 +0.2% 1.00x (?)
ArrayAppendUTF16 81246 82112 +1.1% 0.99x
ArrayInClass 4928 4915 -0.3% 1.00x
ArrayLiteral 1487 1485 -0.1% 1.00x
ArrayOfGenericPOD 3074 3071 -0.1% 1.00x
ArrayOfGenericRef 9609 9597 -0.1% 1.00x (?)
ArrayOfPOD 1832 1832 +0.0% 1.00x
ArrayOfRef 8754 8759 +0.1% 1.00x (?)
ArrayPlusEqualArrayOfInt 652 653 +0.2% 1.00x
ArrayPlusEqualFiveElementCollection 285358 287353 +0.7% 0.99x (?)
ArrayPlusEqualSingleElementCollection 280518 285062 +1.6% 0.98x
ArrayPlusEqualThreeElements 10073 10095 +0.2% 1.00x (?)
ArraySubscript 4166 4150 -0.4% 1.00x
ArrayValueProp 3037 3030 -0.2% 1.00x
ArrayValueProp2 3691 3727 +1.0% 0.99x (?)
ArrayValueProp3 3450 3439 -0.3% 1.00x
ArrayValueProp4 3370 3436 +2.0% 0.98x
BitCount 887 882 -0.6% 1.01x
ByteSwap 263 267 +1.5% 0.99x (?)
CStringLongAscii 5324 5262 -1.2% 1.01x
CStringLongNonAscii 2364 2420 +2.4% 0.98x
CStringShortAscii 8390 8395 +0.1% 1.00x (?)
Calculator 1177 1156 -1.8% 1.02x
CaptureProp 110335 108799 -1.4% 1.01x
CharacterLiteralsLarge 9991 10007 +0.2% 1.00x (?)
CharacterLiteralsSmall 1001 1002 +0.1% 1.00x
Chars 7449 7449 +0.0% 1.00x
ClassArrayGetter 932 932 +0.0% 1.00x
DeadArray 118898 117484 -1.2% 1.01x (?)
Dictionary 1682 1694 +0.7% 0.99x (?)
Dictionary2 3494 3489 -0.1% 1.00x (?)
Dictionary2OfObjects 5769 5825 +1.0% 0.99x
Dictionary3 1333 1321 -0.9% 1.01x
Dictionary3OfObjects 2222 2207 -0.7% 1.01x
DictionaryBridge 2754 2704 -1.8% 1.02x (?)
DictionaryLiteral 8299 8256 -0.5% 1.01x
DictionaryOfObjects 4559 4560 +0.0% 1.00x (?)
DictionaryRemove 21264 22199 +4.4% 0.96x
DictionaryRemoveOfObjects 55165 55038 -0.2% 1.00x (?)
DictionarySwap 5581 5586 +0.1% 1.00x (?)
DictionarySwapOfObjects 19814 20010 +1.0% 0.99x (?)
DropFirstAnyCollection 19253 19450 +1.0% 0.99x (?)
DropFirstAnyCollectionLazy 134734 134431 -0.2% 1.00x (?)
DropFirstAnySeqCRangeIter 30165 30586 +1.4% 0.99x
DropFirstAnySeqCRangeIterLazy 29783 30368 +2.0% 0.98x
DropFirstAnySeqCntRange 19608 19190 -2.1% 1.02x
DropFirstAnySeqCntRangeLazy 19172 19305 +0.7% 0.99x
DropFirstAnySequence 14021 13997 -0.2% 1.00x (?)
DropFirstAnySequenceLazy 14135 14033 -0.7% 1.01x (?)
DropFirstArray 6201 6421 +3.5% 0.97x
DropFirstArrayLazy 44335 44130 -0.5% 1.00x (?)
DropFirstCountableRange 335 335 +0.0% 1.00x
DropFirstCountableRangeLazy 37460 38348 +2.4% 0.98x
DropFirstSequence 13119 13009 -0.8% 1.01x (?)
DropFirstSequenceLazy 12924 12860 -0.5% 1.00x
DropLastAnyCollection 6429 6471 +0.7% 0.99x (?)
DropLastAnyCollectionLazy 45551 44835 -1.6% 1.02x
DropLastAnySeqCRangeIter 43501 44284 +1.8% 0.98x
DropLastAnySeqCRangeIterLazy 44233 44279 +0.1% 1.00x (?)
DropLastAnySeqCntRange 6456 6415 -0.6% 1.01x (?)
DropLastAnySeqCntRangeLazy 6399 6452 +0.8% 0.99x
DropLastAnySequence 29603 29663 +0.2% 1.00x
DropLastAnySequenceLazy 28999 29041 +0.1% 1.00x
DropLastArray 2074 2148 +3.6% 0.97x
DropLastArrayLazy 14805 14739 -0.4% 1.00x
DropLastCountableRange 117 117 +0.0% 1.00x
DropLastCountableRangeLazy 12487 12777 +2.3% 0.98x
DropLastSequence 28568 28594 +0.1% 1.00x (?)
DropLastSequenceLazy 28868 28799 -0.2% 1.00x
DropWhileAnyCollection 24951 25273 +1.3% 0.99x
DropWhileAnyCollectionLazy 26960 27885 +3.4% 0.97x
DropWhileAnySeqCRangeIter 31634 32302 +2.1% 0.98x
DropWhileAnySeqCRangeIterLazy 27136 27611 +1.8% 0.98x
DropWhileAnySeqCntRange 24804 25080 +1.1% 0.99x (?)
DropWhileAnySeqCntRangeLazy 27027 27810 +2.9% 0.97x
DropWhileAnySequence 16122 16106 -0.1% 1.00x (?)
DropWhileAnySequenceLazy 12839 12715 -1.0% 1.01x (?)
DropWhileArray 9794 9897 +1.1% 0.99x
DropWhileArrayLazy 17130 16896 -1.4% 1.01x
DropWhileCountableRange 6093 6372 +4.6% 0.96x
DropWhileCountableRangeLazy 26020 26697 +2.6% 0.97x (?)
DropWhileSequence 15087 15076 -0.1% 1.00x (?)
DropWhileSequenceLazy 11209 11195 -0.1% 1.00x (?)
ErrorHandling 3829 3840 +0.3% 1.00x (?)
GlobalClass 0 0 +0.0% 1.00x
Hanoi 17995 17761 -1.3% 1.01x
HashQuadratic 49348991 48823313 -1.1% 1.01x
HashTest 18778 18499 -1.5% 1.02x
Histogram 8754 8837 +0.9% 0.99x
Integrate 395 395 +0.0% 1.00x
IterateData 12817 12831 +0.1% 1.00x
Join 1269 1252 -1.3% 1.01x
LazilyFilteredArrays 1682988 1693396 +0.6% 0.99x
LazilyFilteredRange 692263 688181 -0.6% 1.01x (?)
LinkedList 33129 33136 +0.0% 1.00x
MapReduce 37939 37570 -1.0% 1.01x (?)
MapReduceAnyCollection 37998 37578 -1.1% 1.01x (?)
MapReduceAnyCollectionShort 50862 50578 -0.6% 1.01x (?)
MapReduceClass 43185 43072 -0.3% 1.00x (?)
MapReduceClassShort 53993 54266 +0.5% 0.99x (?)
MapReduceLazyCollection 33983 34871 +2.6% 0.97x
MapReduceLazyCollectionShort 44226 45121 +2.0% 0.98x
MapReduceLazySequence 25642 25819 +0.7% 0.99x
MapReduceSequence 41134 41718 +1.4% 0.99x
MapReduceShort 50160 50243 +0.2% 1.00x (?)
MapReduceShortString 280 276 -1.4% 1.01x (?)
MapReduceString 2610 2605 -0.2% 1.00x (?)
Memset 46519 46520 +0.0% 1.00x (?)
MonteCarloE 135097 135097 +0.0% 1.00x
MonteCarloPi 52544 52540 -0.0% 1.00x (?)
NSDictionaryCastToSwift 6516 6413 -1.6% 1.02x (?)
NSError 701 718 +2.4% 0.98x
NSStringConversion 1299 1327 +2.2% 0.98x
NopDeinit 53333 53355 +0.0% 1.00x (?)
ObjectAllocation 636 644 +1.3% 0.99x
ObjectiveCBridgeFromNSArrayAnyObject 25911 25431 -1.9% 1.02x
ObjectiveCBridgeFromNSArrayAnyObjectForced 7915 7892 -0.3% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 45088 45123 +0.1% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 38419 39172 +2.0% 0.98x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 122006 121840 -0.1% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 102226 101314 -0.9% 1.01x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 95964 95474 -0.5% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObject 67766 68122 +0.5% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7060 7046 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 76172 75998 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 66273 65523 -1.1% 1.01x (?)
ObjectiveCBridgeFromNSString 4005 4026 +0.5% 0.99x
ObjectiveCBridgeFromNSStringForced 2734 2754 +0.7% 0.99x (?)
ObjectiveCBridgeStubDataAppend 3877 3975 +2.5% 0.98x
ObjectiveCBridgeStubDateAccess 1029 1016 -1.3% 1.01x (?)
ObjectiveCBridgeStubDateMutation 485 485 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 29152 28798 -1.2% 1.01x (?)
ObjectiveCBridgeStubFromNSDate 4032 4032 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDateRef 3973 3974 +0.0% 1.00x (?)
ObjectiveCBridgeStubFromNSString 975 960 -1.5% 1.02x
ObjectiveCBridgeStubFromNSStringRef 207 206 -0.5% 1.00x
ObjectiveCBridgeStubNSDataAppend 2701 2701 +0.0% 1.00x
ObjectiveCBridgeStubNSDateMutationRef 16158 16506 +2.2% 0.98x (?)
ObjectiveCBridgeStubNSDateRefAccess 1282 1281 -0.1% 1.00x
ObjectiveCBridgeStubToArrayOfNSString 29254 28713 -1.8% 1.02x
ObjectiveCBridgeStubToNSDate 15390 15651 +1.7% 0.98x (?)
ObjectiveCBridgeStubToNSDateRef 3419 3427 +0.2% 1.00x (?)
ObjectiveCBridgeStubToNSString 1569 1556 -0.8% 1.01x (?)
ObjectiveCBridgeStubToNSStringRef 148 149 +0.7% 0.99x
ObjectiveCBridgeStubURLAppendPath 222063 222044 -0.0% 1.00x (?)
ObjectiveCBridgeStubURLAppendPathRef 217204 221584 +2.0% 0.98x (?)
ObjectiveCBridgeToNSArray 29123 29219 +0.3% 1.00x (?)
ObjectiveCBridgeToNSDictionary 45706 45478 -0.5% 1.01x (?)
ObjectiveCBridgeToNSSet 39527 39754 +0.6% 0.99x (?)
ObjectiveCBridgeToNSString 1308 1307 -0.1% 1.00x
ObserverClosure 6753 6935 +2.7% 0.97x
ObserverForwarderStruct 4678 4671 -0.1% 1.00x
ObserverPartiallyAppliedMethod 8188 8415 +2.8% 0.97x
ObserverUnappliedMethod 8431 8412 -0.2% 1.00x (?)
OpenClose 394 395 +0.3% 1.00x
Phonebook 24342 24556 +0.9% 0.99x
PolymorphicCalls 2986 2886 -3.3% 1.03x
PopFrontArray 7400 7456 +0.8% 0.99x
PopFrontArrayGeneric 6326 6463 +2.2% 0.98x
PopFrontUnsafePointer 98260 98094 -0.2% 1.00x (?)
PrefixAnyCollection 19363 19404 +0.2% 1.00x (?)
PrefixAnyCollectionLazy 134590 134887 +0.2% 1.00x (?)
PrefixAnySeqCRangeIter 24535 24517 -0.1% 1.00x (?)
PrefixAnySeqCRangeIterLazy 24009 24445 +1.8% 0.98x (?)
PrefixAnySeqCntRange 19237 19287 +0.3% 1.00x (?)
PrefixAnySeqCntRangeLazy 19117 19298 +0.9% 0.99x
PrefixAnySequence 11774 11779 +0.0% 1.00x (?)
PrefixAnySequenceLazy 11835 11843 +0.1% 1.00x (?)
PrefixArray 6202 6417 +3.5% 0.97x
PrefixArrayLazy 44492 44411 -0.2% 1.00x
PrefixCountableRange 337 337 +0.0% 1.00x
PrefixCountableRangeLazy 37591 38308 +1.9% 0.98x
PrefixSequence 10668 10713 +0.4% 1.00x
PrefixSequenceLazy 10752 10635 -1.1% 1.01x
PrefixWhileAnyCollection 36358 36837 +1.3% 0.99x
PrefixWhileAnyCollectionLazy 22296 23042 +3.3% 0.97x
PrefixWhileAnySeqCRangeIter 40734 41035 +0.7% 0.99x
PrefixWhileAnySeqCRangeIterLazy 22268 22930 +3.0% 0.97x (?)
PrefixWhileAnySeqCntRange 36159 36599 +1.2% 0.99x (?)
PrefixWhileAnySeqCntRangeLazy 22322 22903 +2.6% 0.97x (?)
PrefixWhileAnySequence 29632 29605 -0.1% 1.00x
PrefixWhileAnySequenceLazy 11219 11074 -1.3% 1.01x
PrefixWhileArray 16821 16942 +0.7% 0.99x
PrefixWhileArrayLazy 14980 14821 -1.1% 1.01x
PrefixWhileCountableRange 17467 18160 +4.0% 0.96x
PrefixWhileCountableRangeLazy 21638 22370 +3.4% 0.97x
PrefixWhileSequence 28366 28559 +0.7% 0.99x
PrefixWhileSequenceLazy 10569 10519 -0.5% 1.00x
Prims 8901 8924 +0.3% 1.00x (?)
ProtocolDispatch 6974 7134 +2.3% 0.98x (?)
ProtocolDispatch2 490 490 +0.0% 1.00x
RC4 19297 19335 +0.2% 1.00x (?)
RGBHistogram 33870 33937 +0.2% 1.00x (?)
RGBHistogramOfObjects 99417 98956 -0.5% 1.00x (?)
RangeAssignment 5704 5684 -0.4% 1.00x (?)
RecursiveOwnedParameter 9560 9575 +0.2% 1.00x
ReversedArray 590 590 +0.0% 1.00x
ReversedBidirectional 73610 73935 +0.4% 1.00x (?)
ReversedDictionary 25823 25833 +0.0% 1.00x (?)
SetExclusiveOr 20925 21460 +2.6% 0.98x
SetExclusiveOr_OfObjects 41408 41419 +0.0% 1.00x (?)
SetIntersect 10641 10707 +0.6% 0.99x
SetIntersect_OfObjects 11388 11257 -1.2% 1.01x
SetIsSubsetOf 1641 1620 -1.3% 1.01x
SetIsSubsetOf_OfObjects 1520 1531 +0.7% 0.99x
SetUnion 12058 12151 +0.8% 0.99x
SetUnion_OfObjects 29710 29822 +0.4% 1.00x
SevenBoom 1605 1595 -0.6% 1.01x
Sim2DArray 30019 30023 +0.0% 1.00x (?)
SortLargeExistentials 17721 17769 +0.3% 1.00x
SortLettersInPlace 2854 2821 -1.2% 1.01x (?)
SortSortedStrings 1409 1403 -0.4% 1.00x
SortStrings 2479 2476 -0.1% 1.00x
SortStringsUnicode 8821 8859 +0.4% 1.00x
StackPromo 102529 102254 -0.3% 1.00x
StaticArray 4573 4572 -0.0% 1.00x (?)
StrComplexWalk 6938 6858 -1.2% 1.01x
StrToInt 5171 5108 -1.2% 1.01x
StringAdder 48 46 -4.2% 1.04x
StringBuilder 2767 2753 -0.5% 1.01x (?)
StringBuilderLong 1068 1109 +3.8% 0.96x (?)
StringEdits 486016 494655 +1.8% 0.98x
StringEqualPointerComparison 9575 9604 +0.3% 1.00x
StringHasPrefix 1701 1637 -3.8% 1.04x
StringHasPrefixUnicode 16272 16520 +1.5% 0.98x
StringHasSuffix 1867 1843 -1.3% 1.01x
StringHasSuffixUnicode 63848 63475 -0.6% 1.01x
StringInterpolation 12165 11959 -1.7% 1.02x (?)
StringMatch 30827 31261 +1.4% 0.99x (?)
StringUTF16Builder 3608 3551 -1.6% 1.02x (?)
StringWalk 21601 22452 +3.9% 0.96x
StringWithCString 135239 134336 -0.7% 1.01x
SuffixAnyCollection 6442 6477 +0.5% 0.99x (?)
SuffixAnyCollectionLazy 44946 44708 -0.5% 1.01x (?)
SuffixAnySeqCRangeIter 41215 41849 +1.5% 0.98x
SuffixAnySeqCRangeIterLazy 41578 41608 +0.1% 1.00x (?)
SuffixAnySeqCntRange 6457 6406 -0.8% 1.01x
SuffixAnySeqCntRangeLazy 6397 6451 +0.8% 0.99x
SuffixAnySequence 27062 27069 +0.0% 1.00x (?)
SuffixAnySequenceLazy 26785 26775 -0.0% 1.00x (?)
SuffixArray 2080 2149 +3.3% 0.97x
SuffixArrayLazy 14860 14845 -0.1% 1.00x (?)
SuffixCountableRange 117 117 +0.0% 1.00x
SuffixCountableRangeLazy 12500 12774 +2.2% 0.98x
SuffixSequence 26359 26411 +0.2% 1.00x
SuffixSequenceLazy 26511 26558 +0.2% 1.00x (?)
TwoSum 4296 4297 +0.0% 1.00x (?)
TypeFlood 158 163 +3.2% 0.97x (?)
UTF8Decode 37339 37345 +0.0% 1.00x (?)
Walsh 11890 11889 -0.0% 1.00x (?)
XorLoop 25129 25136 +0.0% 1.00x (?)
**Hardware Overview** Model Name: Mac mini Model Identifier: Macmini7,1 Processor Name: Intel Core i5 Processor Speed: 2.8 GHz Number of Processors: 1 Total Number of Cores: 2 L2 Cache (per Core): 256 KB L3 Cache: 3 MB Memory: 16 GB

@milseman
Copy link
Copy Markdown
Member Author

Sweet, that looks better. I'll look into those.

@milseman
Copy link
Copy Markdown
Member Author

Linux platform defines a different pthread_key_t, as suspected. Will fix.

@milseman
Copy link
Copy Markdown
Member Author

@swift-ci please smoke test Linux Platform

@milseman
Copy link
Copy Markdown
Member Author

SuperChars is a legit slowdown. Grapheme breaking performance is sometimes faster and sometimes slower than the tries if we can't hit our fast paths.

Some of the delta is the same inefficient Character construction from a (presumably) valid CharcterView.Index, but not most.

@airspeedswift Any ideas? Are you ok with this?

@airspeedswift
Copy link
Copy Markdown
Member

I think the regression in SuperChars is fine, that benchmark isn't very representative of real usage.

@milseman
Copy link
Copy Markdown
Member Author

@swift-ci please smoke test Linux Platform

@milseman
Copy link
Copy Markdown
Member Author

@swift-ci please test OS X Platform

@swift-ci
Copy link
Copy Markdown
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - f07c0cc9ac0218955bb4039bf4349e53f115a895
Test requested by - @milseman

@milseman
Copy link
Copy Markdown
Member Author

@swift-ci please smoke test Linux Platform

1 similar comment
@milseman
Copy link
Copy Markdown
Member Author

@swift-ci please smoke test Linux Platform

milseman added 8 commits May 10, 2017 15:21
Introduce shims for using UBreakIterators from ICU. Also introduce
shims for using thread local storage via pthreads.

We will be relying on ICU and UBreakIterators for grapheme
breaking. But, UBreakIterators are very expensive to create,
especially for the way we do grapheme breaking, which is relatively
stateless. Thus, we will stash one or more into thread local storage
and reset it as needed.

Note: Currently, pthread_key_t is hard coded for a single platform
(Darwin), but I have a static_assert alongside directions on how to
adapt it to any future platforms who differ in key type.
Introduces a _ThreadLocalStorage struct to hold thread-local, but
global resources. Set it up to host a UBreakIterator and a cache key
for resetting text.

UBreakIterators are extremely expensive to create on the fly, so we
store one for each thread. UBreakIterators are also expensive to bind
to new text, so we cache the text it's currently bound to in order to
help avoid it.

The struct can be expanded with more functionality in the future, but
the standard library should only ever use a single key, and thus
everything should go on this struct. The _ThreadLocalStorage struct is
not meant to be copyable, creatable (by anyone else except the
once-per-thread initialize routine), and should accessed through the
pointers it provides.

Future immediate directions could include cashing multiple
UBreakIterators (e.g. avoid a text reset for mutual character
iteration patterns, etc).

Test added in test/stdlib/ThreadLocalStorage.swift.
Use UBreakIterators to perform grapheme breaking. This gives Unicode 9
grapheme breaking (e.g. family emoji) and provides a means to upgrade
to future versions. It also serves as a model for how to serve up
other advanced functionality in ICU to users.

This has tricky performance implications. Some things are faster and a
number of cases are slower. But, careful use of ICU can help mitigate
and amortize these costs. In conjunction with more early detection of
fast paths, overall grapheme breaking for the average user should be
much faster than in Swift 3.

NOTE: This is incomplete. It currently falls back on the legacy tries
for some bridged strings. There are many potential directions for a
general solution, but for now we'll be interatively adding support for
more and more special cases.
Adds in Linux platform support for our pthread TLS. Replace usage of
PTHREAD_KEYS_MAX with a sentinel value, as it's tricky to define
cross-platform and was only lightly used inside sanity checks.
@milseman milseman changed the title DO NOT MERGE: WIP: Unicode 9 and Thread Local Storage [stdlib] Unicode 9 and Thread Local Storage May 10, 2017
@milseman
Copy link
Copy Markdown
Member Author

@swift-ci please smoke test

Disables the portions of the regional break test file corresponding to
Unicode 8.0 vs 9.0 differences. Once the compiler and stdlib are in
sync with Unicode 9.0, and the legacy tries are dropped, we should
splat down newer versions of these test files.
@milseman
Copy link
Copy Markdown
Member Author

@swift-ci please test

@swift-ci
Copy link
Copy Markdown
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 0995a37387b797b88872b3572595a26a5a739d82
Test requested by - @milseman

@swift-ci
Copy link
Copy Markdown
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - f07c0cc9ac0218955bb4039bf4349e53f115a895
Test requested by - @milseman

@milseman
Copy link
Copy Markdown
Member Author

Just to be extra cautious, I'm going to wait for that OS X test to finish...

@milseman milseman merged commit 26f7659 into swiftlang:master May 11, 2017
milseman added a commit to milseman/swift that referenced this pull request May 11, 2017
This reverts commit 26f7659, reversing
changes made to 7b927e5.
shahmishal added a commit that referenced this pull request May 11, 2017
Revert "Merge pull request #9265 from milseman/tls_ftw"
@CodaFi CodaFi mentioned this pull request Jul 6, 2017
1 task
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.

4 participants