Skip to content

Thread-safety for the type metadata cache #31663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dabrahams
Copy link
Contributor

You'll probably want something that avoids the recursive mutex, at least in the common case, but this fixes the immediate correctness issue.

You'll probably want something that avoids the recursive mutex, at least in the common case, but this fixes the immediate correctness issue.
@dabrahams
Copy link
Contributor Author

@swift-ci Please benchmark

@dabrahams
Copy link
Contributor Author

@swift-ci Please test

@compnerd compnerd requested review from mikeash and compnerd May 8, 2020 23:10
@gottesmm
Copy link
Contributor

gottesmm commented May 8, 2020

@dabrahams test case?

@dabrahams
Copy link
Contributor Author

@gottesmm I'm trying to reduce it; the one we have is big and involves tensorflow. tsan blames the metadata cache, though.

@aschwaighofer
Copy link
Contributor

Hmm, the cache variable is supposed to be a init once global that is supposed to be thread safe and the Metadata cache itself is supposed to be a concurrent map.

Is the issue on the mac?

Sounds like we have a bug somewhere.

CC @rjmccall

@compnerd
Copy link
Member

compnerd commented May 8, 2020

@dabrahams the TSAN results would be useful too

@pschuh
Copy link
Contributor

pschuh commented May 9, 2020

in swift_getAssociatedTypeWitness
it is the:

auto *witnessAddr = &((const void* *)wtable)[witnessIndex];
auto witness = *witnessAddr; // <---- here

@dabrahams
Copy link
Contributor Author

Heh, @pschuh reports that my reproducer is tickling a different bug. He's working on reducing our large test case. @aschwaighofer @gottesmm would you like me to file bugs in Jira for these?

@swift-ci
Copy link
Contributor

swift-ci commented May 9, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
Diffing.Same 5 12 +140.0% 0.42x
Breadcrumbs.UTF16ToIdx.longASCII 107 236 +120.6% 0.45x
Breadcrumbs.IdxToUTF16.longASCII 109 239 +119.3% 0.46x
Breadcrumbs.IdxToUTF16Range.longASCII 27 52 +92.6% 0.52x
String.replaceSubrange.RepChar 2062 3806 +84.6% 0.54x
String.replaceSubrange.RepChar.Small 262 482 +84.0% 0.54x
Dictionary2 610 1070 +75.4% 0.57x
StringInterpolationSmall 1260 2160 +71.4% 0.58x
Join 154 249 +61.7% 0.62x
String.data.Empty 26 40 +53.8% 0.65x (?)
String.data.Small 28 41 +46.4% 0.68x
NSDictionaryCastToSwift 870 1240 +42.5% 0.70x
SuffixAnySeqCntRangeLazy 42693 60390 +41.5% 0.71x
DropFirstAnyCollectionLazy 63188 89321 +41.4% 0.71x
SequenceAlgosAnySequence 25800 36400 +41.1% 0.71x
SuffixAnyCollectionLazy 21195 29705 +40.2% 0.71x
SuffixAnySeqCRangeIterLazy 43601 60928 +39.7% 0.72x
DropLastAnySeqCRangeIterLazy 43550 60849 +39.7% 0.72x
Diffing.ReversedAlphabets 190 265 +39.5% 0.72x
DropLastAnyCollectionLazy 21180 29537 +39.5% 0.72x
DropLastAnySeqCntRangeLazy 43823 60778 +38.7% 0.72x
PrefixAnyCollectionLazy 63963 88665 +38.6% 0.72x
Diffing.Disparate 156 216 +38.5% 0.72x
ReversedBidirectional 7318 9869 +34.9% 0.74x
EqualStringSubstring 23 31 +34.8% 0.74x
Breadcrumbs.MutatedUTF16ToIdx.ASCII 3 4 +33.3% 0.75x
Breadcrumbs.MutatedIdxToUTF16.ASCII 3 4 +33.3% 0.75x
Breadcrumbs.UTF16ToIdx.longMixed 321 426 +32.7% 0.75x
EqualSubstringSubstring 23 30 +30.4% 0.77x
LessSubstringSubstring 23 30 +30.4% 0.77x
EqualSubstringSubstringGenericEquatable 23 30 +30.4% 0.77x
EqualSubstringString 23 30 +30.4% 0.77x
LessSubstringSubstringGenericComparable 23 30 +30.4% 0.77x
Dictionary2OfObjects 1535 1995 +30.0% 0.77x (?)
CSVParsing.Scalar 133 166 +24.8% 0.80x
ObjectiveCBridgeFromNSSetAnyObjectForced 2780 3460 +24.5% 0.80x
Diffing.ReversedLorem 1063 1320 +24.2% 0.81x (?)
String.data.Medium 63 78 +23.8% 0.81x (?)
String.data.LargeUnicode 70 86 +22.9% 0.81x (?)
Diffing.PangramToAlphabet 1085 1328 +22.4% 0.82x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4350 5300 +21.8% 0.82x (?)
ArrayInitFromSlice 243 296 +21.8% 0.82x
DictionaryOfAnyHashableStrings_insert 3248 3864 +19.0% 0.84x
ObjectiveCBridgeFromNSStringForced 1470 1735 +18.0% 0.85x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 49000 57500 +17.3% 0.85x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 2900 3400 +17.2% 0.85x (?)
StringUTF16SubstringBuilder 2320 2710 +16.8% 0.86x
ObjectiveCBridgeStubFromArrayOfNSString2 1800 2100 +16.7% 0.86x
DictionaryOfAnyHashableStrings_lookup 2688 3120 +16.1% 0.86x
DictionaryBridgeToObjC_Bridge 13 15 +15.4% 0.87x
StringBuilderWithLongSubstring 1180 1360 +15.3% 0.87x (?)
Diffing.Pangrams 2998 3372 +12.5% 0.89x (?)
AnyHashableWithAClass 85500 96000 +12.3% 0.89x (?)
Breadcrumbs.IdxToUTF16.longMixed 754 839 +11.3% 0.90x (?)
StringComparison_longSharedPrefix 322 358 +11.2% 0.90x (?)
StringEdits 58300 64700 +11.0% 0.90x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 41000 45500 +11.0% 0.90x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 26000 28800 +10.8% 0.90x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 25700 28400 +10.5% 0.90x (?)
Diffing.Myers.Similar 330 364 +10.3% 0.91x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 44500 49000 +10.1% 0.91x (?)
NormalizedIterator_fastPrenormal 620 680 +9.7% 0.91x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 51000 55500 +8.8% 0.92x (?)
Diffing.Similar 341 371 +8.8% 0.92x (?)
PlistPerfDecode 184 200 +8.7% 0.92x (?)
JSONPerfDecode 178 193 +8.4% 0.92x (?)
ObjectiveCBridgeFromNSArrayAnyObject 13700 14800 +8.0% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 86 78 -9.3% 1.10x (?)
AngryPhonebook 273 252 -7.7% 1.08x (?)
ArrayAppendLazyMap 4110 3820 -7.1% 1.08x (?)
AngryPhonebook.Armenian 172 160 -7.0% 1.07x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
Diffing.Same 5 12 +140.0% 0.42x
PrefixAnySequence 2540 5771 +127.2% 0.44x
Breadcrumbs.UTF16ToIdx.longASCII 111 241 +117.1% 0.46x
Breadcrumbs.IdxToUTF16.longASCII 111 240 +116.2% 0.46x
Breadcrumbs.IdxToUTF16Range.longASCII 27 52 +92.6% 0.52x
String.replaceSubrange.RepChar 2141 3862 +80.4% 0.55x
String.replaceSubrange.RepChar.Small 266 478 +79.7% 0.56x
Dictionary2 630 1080 +71.4% 0.58x
StringInterpolationSmall 1300 2190 +68.5% 0.59x
Join 156 250 +60.3% 0.62x
String.data.Empty 26 39 +50.0% 0.67x
PrefixAnySeqCRangeIter 32809 49140 +49.8% 0.67x
PrefixAnySeqCntRange 33783 48857 +44.6% 0.69x
String.data.Small 29 41 +41.4% 0.71x
DropFirstAnyCollectionLazy 63304 89388 +41.2% 0.71x
Diffing.ReversedAlphabets 190 268 +41.1% 0.71x
NSDictionaryCastToSwift 880 1240 +40.9% 0.71x
DropLastAnyCollectionLazy 21188 29561 +39.5% 0.72x
SequenceAlgosAnySequence 26400 36800 +39.4% 0.72x
DropLastAnySeqCRangeIterLazy 43615 60722 +39.2% 0.72x
DropFirstAnySeqCRangeIter 43350 60320 +39.1% 0.72x
Diffing.Disparate 156 217 +39.1% 0.72x
DropFirstAnySeqCntRange 43686 60594 +38.7% 0.72x
DropLastAnySeqCntRangeLazy 43904 60655 +38.2% 0.72x
PrefixAnyCollectionLazy 64111 88277 +37.7% 0.73x
SuffixAnySeqCRangeIterLazy 44379 60812 +37.0% 0.73x
SuffixAnyCollectionLazy 21597 29546 +36.8% 0.73x
SuffixAnySeqCntRangeLazy 44533 60571 +36.0% 0.74x
EqualSubstringSubstring 23 31 +34.8% 0.74x
LessSubstringSubstring 23 31 +34.8% 0.74x
EqualStringSubstring 23 31 +34.8% 0.74x
EqualSubstringSubstringGenericEquatable 23 31 +34.8% 0.74x
LessSubstringSubstringGenericComparable 23 31 +34.8% 0.74x
Breadcrumbs.UTF16ToIdx.longMixed 317 426 +34.4% 0.74x
Breadcrumbs.MutatedUTF16ToIdx.ASCII 3 4 +33.3% 0.75x
Breadcrumbs.MutatedIdxToUTF16.ASCII 3 4 +33.3% 0.75x
EqualSubstringString 23 30 +30.4% 0.77x
Dictionary2OfObjects 1540 2005 +30.2% 0.77x
ReversedBidirectional 9429 11934 +26.6% 0.79x
CSVParsing.Scalar 133 168 +26.3% 0.79x
Diffing.ReversedLorem 1078 1353 +25.5% 0.80x
String.data.Medium 65 80 +23.1% 0.81x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 2840 3480 +22.5% 0.82x
Diffing.PangramToAlphabet 1109 1356 +22.3% 0.82x (?)
ArrayInitFromSlice 243 295 +21.4% 0.82x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4650 5600 +20.4% 0.83x (?)
String.data.LargeUnicode 71 84 +18.3% 0.85x (?)
ObjectiveCBridgeFromNSStringForced 1495 1760 +17.7% 0.85x
DictionaryOfAnyHashableStrings_insert 3304 3878 +17.4% 0.85x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 50500 59000 +16.8% 0.86x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 2900 3380 +16.6% 0.86x (?)
ObjectiveCBridgeStubFromArrayOfNSString2 1800 2090 +16.1% 0.86x (?)
DictionaryBridgeToObjC_Bridge 13 15 +15.4% 0.87x
DictionaryOfAnyHashableStrings_lookup 2712 3120 +15.0% 0.87x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 25600 29400 +14.8% 0.87x (?)
DictionaryLiteral 2910 3300 +13.4% 0.88x
AnyHashableWithAClass 85000 96000 +12.9% 0.89x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 25500 28700 +12.5% 0.89x (?)
StringUTF16SubstringBuilder 2620 2940 +12.2% 0.89x (?)
StringComparison_longSharedPrefix 327 358 +9.5% 0.91x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 42500 46500 +9.4% 0.91x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 45500 49500 +8.8% 0.92x (?)
Set.isSubset.Int.Empty 47 51 +8.5% 0.92x (?)
DictionaryBridgeToObjC_Access 501 542 +8.2% 0.92x (?)
Set.isSubset.Seq.Int.Empty 111 120 +8.1% 0.93x (?)
StringInterpolation 7500 8100 +8.0% 0.93x (?)
StringEdits 60800 65600 +7.9% 0.93x (?)
DictionaryBridge 456 491 +7.7% 0.93x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 52500 56500 +7.6% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
AngryPhonebook 280 252 -10.0% 1.11x
Set.isSubset.Seq.Empty.Int 84 77 -8.3% 1.09x (?)
ObjectiveCBridgeStringHash 86 79 -8.1% 1.09x (?)
ArrayAppendLazyMap 4350 4020 -7.6% 1.08x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
DataCreateMedium 449900 1623000 +260.7% 0.28x
BitCount 40524 138282 +241.2% 0.29x
DataCreateSmall 53230 175350 +229.4% 0.30x
Data.append.Sequence.64kB.Count0.I 3444 11037 +220.5% 0.31x
Data.append.Sequence.809B.Count0 4282 13692 +219.8% 0.31x
Data.append.Sequence.64kB.Count0 3461 11040 +219.0% 0.31x
Data.init.Sequence.64kB.Count0.I 3466 11041 +218.6% 0.31x
Data.append.Sequence.809B.Count0.I 4306 13693 +218.0% 0.31x
Data.init.Sequence.64kB.Count.I 3466 10997 +217.3% 0.32x
Data.append.Sequence.64kB.Count.I 3467 10998 +217.2% 0.32x
Data.init.Sequence.64kB.Count 3467 10995 +217.1% 0.32x
Data.init.Sequence.2047B.Count0.I 5469 17343 +217.1% 0.32x
Data.init.Sequence.2049B.Count0.I 5471 17327 +216.7% 0.32x
Data.append.Sequence.64kB.Count 3470 10987 +216.6% 0.32x
Data.init.Sequence.2047B.Count.I 5446 17205 +215.9% 0.32x
Data.init.Sequence.2049B.Count.I 5456 17233 +215.9% 0.32x
Data.init.Sequence.809B.Count0.I 4369 13733 +214.3% 0.32x
Data.init.Sequence.809B.Count.I 4347 13632 +213.6% 0.32x
Data.init.Sequence.809B.Count0 4383 13744 +213.6% 0.32x
Data.append.Sequence.809B.Count.I 4354 13647 +213.4% 0.32x
Data.init.Sequence.513B.Count.I 4157 13015 +213.1% 0.32x
Data.init.Sequence.511B.Count.I 4141 12958 +212.9% 0.32x
Data.init.Sequence.64kB.Count0 3529 11041 +212.9% 0.32x
Data.init.Sequence.513B.Count0.I 4203 13134 +212.5% 0.32x
Data.init.Sequence.511B.Count0.I 4190 13075 +212.1% 0.32x
Data.init.Sequence.809B.Count 4368 13627 +212.0% 0.32x
Set.isSuperset.Seq.Empty.Int 339 1055 +211.2% 0.32x
Data.append.Sequence.809B.Count 4403 13646 +209.9% 0.32x
HTTP2StateMachine 2514600 7545004 +200.0% 0.33x
ArraySubscript 285164 851076 +198.5% 0.34x
MonteCarloE 2942940 8655900 +194.1% 0.34x
MonteCarloPi 14299625 42058625 +194.1% 0.34x
Set.isDisjoint.Seq.Int.Empty 376 1089 +189.6% 0.35x
ByteSwap 41821 120777 +188.8% 0.35x
Set.isDisjoint.Seq.Box.Empty 436 1256 +188.1% 0.35x
Radix2CooleyTukeyf 106656 307056 +187.9% 0.35x
Radix2CooleyTukey 111456 311472 +179.5% 0.36x
ArrayAppendSequence 62280 159230 +155.7% 0.39x
Set.subtracting.Seq.Box.Empty 625 1585 +153.6% 0.39x
Set.subtracting.Seq.Int.Empty 557 1403 +151.9% 0.40x
Diffing.Same 5 12 +140.0% 0.42x
RandomIntegersLCG 28061 63408 +126.0% 0.44x
NSStringConversion.Mutable 1667 3763 +125.7% 0.44x
CharIndexing_tweet_unicodeScalars_Backwards 862680 1909040 +121.3% 0.45x
CharIndexing_russian_unicodeScalars_Backwards 361240 797640 +120.8% 0.45x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 74720 164800 +120.6% 0.45x
CharIndexing_punctuated_unicodeScalars_Backwards 94840 208880 +120.2% 0.45x
CharIndexing_korean_unicodeScalars_Backwards 424080 932560 +119.9% 0.45x
CharIndexing_ascii_unicodeScalars_Backwards 436320 957360 +119.4% 0.46x
CharIndexing_japanese_unicodeScalars_Backwards 527080 1152080 +118.6% 0.46x
CharIndexing_chinese_unicodeScalars_Backwards 330480 722160 +118.5% 0.46x
Set.isDisjoint.Empty.Box 331 709 +114.2% 0.47x
Set.isSubset.Seq.Int.Empty 678 1441 +112.5% 0.47x
CharIndexing_ascii_unicodeScalars 399920 848200 +112.1% 0.47x
Set.isStrictSubset.Seq.Int.Empty 681 1439 +111.3% 0.47x
RandomDoubleLCG 38754 81754 +111.0% 0.47x
CharIndexing_tweet_unicodeScalars 801160 1684200 +110.2% 0.48x
CharIndexing_punctuated_unicodeScalars 88400 185360 +109.7% 0.48x
CharIndexing_korean_unicodeScalars 394040 826200 +109.7% 0.48x
CharIndexing_punctuatedJapanese_unicodeScalars 69880 146480 +109.6% 0.48x
CharIndexing_japanese_unicodeScalars 486640 1019200 +109.4% 0.48x
CharIndexing_russian_unicodeScalars 337000 705720 +109.4% 0.48x
CharIndexing_utf16_unicodeScalars_Backwards 382680 799560 +108.9% 0.48x
CharIndexing_chinese_unicodeScalars 307840 642280 +108.6% 0.48x
RangeIterationSigned 10501 21887 +108.4% 0.48x
HashTest 10830 22560 +108.3% 0.48x
CharIndexing_utf16_unicodeScalars 353960 723880 +104.5% 0.49x
Set.subtracting.Box.Empty 100 203 +103.0% 0.49x
NSStringConversion.Long 2990 5998 +100.6% 0.50x
Set.isStrictSuperset.Seq.Empty.Int 781 1560 +99.7% 0.50x
Set.isDisjoint.Seq.Empty.Box 256 510 +99.2% 0.50x
RC4 12890 25666 +99.1% 0.50x
Set.isDisjoint.Box.Empty 453 898 +98.2% 0.50x
ChaCha 37626 74412 +97.8% 0.51x
NSStringConversion.Medium 1188 2331 +96.2% 0.51x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 43680 85480 +95.7% 0.51x
CharIteration_utf16_unicodeScalars_Backwards 200040 390920 +95.4% 0.51x
CharIteration_punctuated_unicodeScalars_Backwards 55080 107400 +95.0% 0.51x
PrefixWhileSequenceLazy 5004 9707 +94.0% 0.52x
CharIteration_tweet_unicodeScalars_Backwards 500600 966680 +93.1% 0.52x
CharIteration_japanese_unicodeScalars_Backwards 303680 585880 +92.9% 0.52x
PrefixSequenceLazy 3367 6479 +92.4% 0.52x
CharIteration_ascii_unicodeScalars_Backwards 253480 487720 +92.4% 0.52x
CharIteration_russian_unicodeScalars_Backwards 212040 407640 +92.2% 0.52x
PrefixSequence 3363 6462 +92.1% 0.52x
PrefixWhileAnySequenceLazy 5269 10122 +92.1% 0.52x
Set.subtracting.Seq.Empty.Box 391 751 +92.1% 0.52x
CharIteration_chinese_unicodeScalars_Backwards 192440 369200 +91.9% 0.52x
Set.subtracting.Empty.Box 71 136 +91.5% 0.52x
NSStringConversion.LongUTF8 1143 2174 +90.2% 0.53x
Set.isDisjoint.Empty.Int 280 531 +89.6% 0.53x
PrefixAnySequenceLazy 3652 6879 +88.4% 0.53x
CharIteration_korean_unicodeScalars_Backwards 251640 473800 +88.3% 0.53x
MapReduceLazySequence 8737 16374 +87.4% 0.53x
ArrayAppendAscii 11322 21216 +87.4% 0.53x
ArrayAppendUTF16 11288 21148 +87.3% 0.53x
Set.isDisjoint.Int.Empty 386 722 +87.0% 0.53x
RandomIntegersDef 40600 75900 +86.9% 0.53x
DropWhileSequence 5400 10077 +86.6% 0.54x
DropWhileSequenceLazy 5326 9933 +86.5% 0.54x
ArrayAppendLatin1 11322 21114 +86.5% 0.54x
DropWhileAnySequenceLazy 5698 10454 +83.5% 0.55x
FloatingPointPrinting_Float_description_uniform 14000 25500 +82.1% 0.55x
CharacterPropertiesStashed 1630 2940 +80.4% 0.55x
UTF8Decode_InitFromCustom_noncontiguous_ascii_as_ascii 91254 164426 +80.2% 0.55x
String.replaceSubrange.RepChar.Small 267 481 +80.1% 0.56x
NSStringConversion.UTF8 1510 2718 +80.0% 0.56x
UTF8Decode_InitFromCustom_noncontiguous 28761 51633 +79.5% 0.56x
UTF8Decode_InitFromCustom_noncontiguous_ascii 91549 164008 +79.1% 0.56x
String.replaceSubrange.RepChar 2172 3881 +78.7% 0.56x
NSStringConversion.MutableCopy.Long 997 1769 +77.4% 0.56x
PrefixAnySequence 4092 7215 +76.3% 0.57x
DropWhileAnySequence 6100 10754 +76.3% 0.57x
RandomDoubleDef 59400 103400 +74.1% 0.57x
PopFrontArrayGeneric 3700 6440 +74.1% 0.57x
Set.subtracting.Int.Empty 99 172 +73.7% 0.58x
MapReduceLazyCollectionShort 26480 45654 +72.4% 0.58x
StringMatch 29800 51300 +72.1% 0.58x
Set.subtracting.Seq.Empty.Int 333 570 +71.2% 0.58x
PrefixWhileArrayLazy 13451 22869 +70.0% 0.59x
ArrayAppendLazyMap 177870 301010 +69.2% 0.59x
LuhnAlgoLazy 2244 3775 +68.2% 0.59x
DropWhileArrayLazy 16371 27439 +67.6% 0.60x
LuhnAlgoEager 2256 3776 +67.4% 0.60x
QueueGeneric 15970 26640 +66.8% 0.60x
PolymorphicCalls 3402 5670 +66.7% 0.60x
MapReduceLazyCollection 23307 38759 +66.3% 0.60x
NSStringConversion.MutableCopy.LongUTF8 778 1291 +65.9% 0.60x
CSVParsingAltIndices2 6391 10593 +65.7% 0.60x
CaptureProp 415860 681880 +64.0% 0.61x
FatCompactMap 265770 435310 +63.8% 0.61x
NSStringConversion.MutableCopy.Medium 941 1541 +63.8% 0.61x
Set.isDisjoint.Int100 601 980 +63.1% 0.61x
Set.isSuperset.Seq.Int.Empty 1188 1931 +62.5% 0.62x
Set.subtracting.Empty.Int 72 117 +62.5% 0.62x
CharacterPropertiesPrecomputed 2170 3510 +61.8% 0.62x
FloatingPointPrinting_Float80_description_uniform 38100 61400 +61.2% 0.62x (?)
Integrate 2121 3418 +61.2% 0.62x
Set.isDisjoint.Seq.Empty.Int 205 329 +60.5% 0.62x (?)
QueueConcrete 13030 20720 +59.0% 0.63x
ChainedFilterMap 211896 336735 +58.9% 0.63x
Set.isSuperset.Seq.Int0 1275 2023 +58.7% 0.63x
CharacterPropertiesStashedMemo 2430 3820 +57.2% 0.64x
ArrayAppendRepeatCol 205860 323390 +57.1% 0.64x
RemoveWhereFilterString 416 653 +57.0% 0.64x
Data.append.Sequence.809B.Count.RE 21009 32976 +57.0% 0.64x
Set.isDisjoint.Seq.Int100 1362 2137 +56.9% 0.64x
Data.init.Sequence.64kB.Count.RE 17012 26681 +56.8% 0.64x
Data.append.Sequence.64kB.Count.RE 16979 26563 +56.4% 0.64x
Data.append.Sequence.64kB.Count.RE.I 17071 26701 +56.4% 0.64x
Data.init.Sequence.809B.Count.RE 21144 33060 +56.4% 0.64x
RemoveWhereQuadraticString 2621 4098 +56.4% 0.64x
Data.append.Sequence.64kB.Count0.RE 16950 26499 +56.3% 0.64x
NibbleSort 553830 865300 +56.2% 0.64x
Set.isSuperset.Seq.Box0 1544 2412 +56.2% 0.64x
Data.init.Sequence.809B.Count.RE.I 21096 32907 +56.0% 0.64x
Data.append.Sequence.809B.Count0.RE.I 21077 32876 +56.0% 0.64x
Data.append.Sequence.64kB.Count0.RE.I 17015 26533 +55.9% 0.64x
Data.append.Sequence.809B.Count.RE.I 21174 33005 +55.9% 0.64x
FindString.Rec3.Substring 590 919 +55.8% 0.64x
Data.init.Sequence.64kB.Count0.RE.I 17016 26486 +55.7% 0.64x
Data.append.Sequence.809B.Count0.RE 21133 32874 +55.6% 0.64x
Data.init.Sequence.64kB.Count0.RE 17085 26529 +55.3% 0.64x
Data.init.Sequence.64kB.Count.RE.I 17103 26555 +55.3% 0.64x
CharIteration_utf16_unicodeScalars 126840 196480 +54.9% 0.65x
MapReduceShortString 164 254 +54.9% 0.65x
DataAppendSequence 2132600 3294900 +54.5% 0.65x
FloatingPointPrinting_Double_description_uniform 24600 38000 +54.5% 0.65x
Data.init.Sequence.809B.Count0.RE.I 21376 32968 +54.2% 0.65x
ArrayValueProp2 16225 24974 +53.9% 0.65x
FindString.Rec3.String 591 908 +53.6% 0.65x (?)
Data.init.Sequence.809B.Count0.RE 21487 32958 +53.4% 0.65x
RemoveWhereFilterInts 2171 3330 +53.4% 0.65x (?)
RomanNumbers2 6572 10078 +53.3% 0.65x
CSVParsing.UTF16 380 581 +52.9% 0.65x
PrefixWhileCountableRangeLazy 33803 51288 +51.7% 0.66x
LazilyFilteredArrayContains 886900 1342600 +51.4% 0.66x
CharIteration_punctuatedJapanese_unicodeScalars 28600 43160 +50.9% 0.66x
CharIteration_punctuated_unicodeScalars 36240 54400 +50.1% 0.67x
PrefixWhileAnyCollectionLazy 34663 52017 +50.1% 0.67x
Set.isStrictSuperset.Seq.Int0 51207 76840 +50.1% 0.67x
String.data.Empty 28 42 +50.0% 0.67x
Breadcrumbs.MutatedUTF16ToIdx.ASCII 14 21 +50.0% 0.67x
Breadcrumbs.MutatedIdxToUTF16.ASCII 14 21 +50.0% 0.67x
CSVParsing.Scalar 449 673 +49.9% 0.67x
PrefixAnySeqCRangeIterLazy 32646 48886 +49.7% 0.67x
Set.isStrictSubset.Seq.Int0 5126 7671 +49.6% 0.67x
CSVParsing.UTF8 425 636 +49.6% 0.67x
PrefixWhileAnySeqCRangeIterLazy 34736 51964 +49.6% 0.67x
DropWhileCountableRangeLazy 44173 66024 +49.5% 0.67x
PrefixWhileAnySeqCntRangeLazy 34698 51852 +49.4% 0.67x
PrefixAnySeqCRangeIter 32851 49090 +49.4% 0.67x
Set.isStrictSuperset.Seq.Int50 5148 7681 +49.2% 0.67x
PrefixAnySeqCntRangeLazy 32588 48557 +49.0% 0.67x
DropWhileAnySeqCntRange 45572 67795 +48.8% 0.67x
Set.isStrictSuperset.Seq.Int25 5164 7677 +48.7% 0.67x
CharIteration_russian_unicodeScalars 136280 202480 +48.6% 0.67x
CharIteration_tweet_unicodeScalars 320880 476400 +48.5% 0.67x
CharIteration_chinese_unicodeScalars 123600 183120 +48.2% 0.67x
StringBuilderSmallReservingCapacity 5476 8112 +48.1% 0.68x
Set.isSubset.Seq.Int0 5184 7676 +48.1% 0.68x
CharIteration_ascii_unicodeScalars 162680 240880 +48.1% 0.68x
Set.isStrictSubset.Seq.Int25 5282 7820 +48.0% 0.68x
ArrayPlusEqualSingleElementCollection 123610 182924 +48.0% 0.68x
ArrayPlusEqualFiveElementCollection 98013 144892 +47.8% 0.68x
DropWhileAnySeqCRangeIterLazy 44833 66264 +47.8% 0.68x
CharIteration_korean_unicodeScalars 160600 237160 +47.7% 0.68x
CharIteration_japanese_unicodeScalars 196440 290000 +47.6% 0.68x
Breadcrumbs.UTF16ToIdx.longASCII 1117 1649 +47.6% 0.68x
RemoveWhereFilterStrings 2654 3912 +47.4% 0.68x
ParseInt.IntSmall.Decimal 10621 15649 +47.3% 0.68x
MapReduceString 1891 2786 +47.3% 0.68x
RangeReplaceableCollectionPlusDefault 4136 6092 +47.3% 0.68x
PrefixAnySeqCntRange 33239 48930 +47.2% 0.68x
StringBuilder 5519 8105 +46.9% 0.68x
DropWhileAnySeqCRangeIter 46253 67898 +46.8% 0.68x
DropWhileAnySeqCntRangeLazy 44885 65886 +46.8% 0.68x
Set.isStrictSubset.Seq.Int50 5425 7963 +46.8% 0.68x
Set.isSubset.Seq.Int25 5342 7826 +46.5% 0.68x
DropWhileAnyCollectionLazy 44906 65777 +46.5% 0.68x
ParseInt.IntSmall.UncommonRadix 11445 16694 +45.9% 0.69x
SequenceAlgosContiguousArray 898880 1310570 +45.8% 0.69x
StrToInt 40070 58400 +45.7% 0.69x
SubstringEquatable 5198 7569 +45.6% 0.69x
DropFirstArray 10847 15790 +45.6% 0.69x
Set.isSubset.Seq.Int50 5486 7969 +45.3% 0.69x
StringUTF16Builder 5560 8070 +45.1% 0.69x
Set.isDisjoint.Int50 823 1194 +45.1% 0.69x
DataToStringEmpty 1000 1450 +45.0% 0.69x
Breadcrumbs.IdxToUTF16.longASCII 1121 1625 +45.0% 0.69x
SuffixArray 3629 5257 +44.9% 0.69x
DropLastArray 3635 5261 +44.7% 0.69x
PrefixArray 10887 15754 +44.7% 0.69x
Breadcrumbs.IdxToUTF16Range.longASCII 235 340 +44.7% 0.69x
Set.isDisjoint.Int25 841 1214 +44.4% 0.69x
SubstringComparable 1825 2634 +44.3% 0.69x
DictionaryCompactMapValuesOfCastValue 36720 52758 +43.7% 0.70x
SetUnionInt100 239 343 +43.5% 0.70x
SequenceAlgosAnySequence 26300 37700 +43.3% 0.70x
String.data.Small 30 43 +43.3% 0.70x
RangeOverlapsClosedRange 18723 26835 +43.3% 0.70x
PrefixAnyCollection 32456 46509 +43.3% 0.70x
ReversedBidirectional 80212 114860 +43.2% 0.70x
SetUnionInt50 344 492 +43.0% 0.70x (?)
Set.intersection.Seq.Int0 1174 1679 +43.0% 0.70x
Set.isSubset.Seq.Int100 5800 8285 +42.8% 0.70x
Set.intersection.Seq.Int100 1641 2335 +42.3% 0.70x
ArrayAppendUTF16Substring 31752 45180 +42.3% 0.70x
SetUnionInt25 392 557 +42.1% 0.70x
ReversedArray2 18516 26305 +42.1% 0.70x
Set.intersection.Seq.Int50 1417 2013 +42.1% 0.70x
LazilyFilteredRange 1074800 1525190 +41.9% 0.70x
SequenceAlgosArray 960850 1363440 +41.9% 0.70x
ArrayAppendAsciiSubstring 31824 45144 +41.9% 0.70x
StringRemoveDupes 550 780 +41.8% 0.71x
Combos 916 1299 +41.8% 0.71x
StringInterpolationSmall 2060 2920 +41.7% 0.71x
Set.intersection.Seq.Int25 1312 1858 +41.6% 0.71x
Diffing.ReversedAlphabets 190 269 +41.6% 0.71x
SequenceAlgosRange 2622850 3710680 +41.5% 0.71x
ArrayAppendLatin1Substring 32292 45684 +41.5% 0.71x
PrefixWhileAnySeqCntRange 45632 64451 +41.2% 0.71x
Set.isStrictSubset.Seq.Int100 6157 8688 +41.1% 0.71x
PrefixWhileAnySeqCRangeIter 45793 64449 +40.7% 0.71x
Set.isStrictSuperset.Seq.Int100 6182 8690 +40.6% 0.71x
DropLastAnySeqCRangeIter 49016 68794 +40.4% 0.71x
DropLastAnySeqCntRangeLazy 49311 69103 +40.1% 0.71x
StringComparison_ascii 11134 15588 +40.0% 0.71x
DropFirstAnySeqCRangeIter 43384 60682 +39.9% 0.71x
NSDictionaryCastToSwift 1480 2070 +39.9% 0.71x (?)
DropLastAnySeqCntRange 49309 68939 +39.8% 0.72x
DropFirstAnySeqCntRange 43528 60846 +39.8% 0.72x
DropLastAnySeqCRangeIterLazy 49267 68852 +39.8% 0.72x
PrefixWhileSequence 15818 22087 +39.6% 0.72x
UTF8Decode 35937 50175 +39.6% 0.72x
DropLastSequence 9184 12810 +39.5% 0.72x
SumUsingReduceInto 194859 271583 +39.4% 0.72x
DropFirstAnySeqCRangeIterLazy 43386 60467 +39.4% 0.72x
CharacterPropertiesFetch 3470 4830 +39.2% 0.72x (?)
StringUTF16SubstringBuilder 11260 15670 +39.2% 0.72x
SumUsingReduce 196097 272888 +39.2% 0.72x
RandomTree.insert.UnsafePointer 309 430 +39.2% 0.72x
SuffixAnySeqCRangeIter 47478 66045 +39.1% 0.72x
Set.isStrictSuperset.Seq.Box0 66069 91889 +39.1% 0.72x
SuffixAnyCollection 10884 15127 +39.0% 0.72x
SuffixAnySeqCntRange 47403 65878 +39.0% 0.72x
ReversedDictionary2 19612 27182 +38.6% 0.72x
Set.isStrictSubset.Seq.Box0 6640 9201 +38.6% 0.72x
DropLastSequenceLazy 9224 12778 +38.5% 0.72x
OpenClose 431 597 +38.5% 0.72x (?)
SetSymmetricDifferenceInt100 522 723 +38.5% 0.72x
Set.isSuperset.Seq.Int100 4180 5789 +38.5% 0.72x
PrefixWhileAnySequence 15919 22038 +38.4% 0.72x
Set.isStrictSuperset.Seq.Box25 6675 9237 +38.4% 0.72x
Set.isSuperset.Seq.Int25 1059 1465 +38.3% 0.72x
SuffixAnyCollectionLazy 45420 62777 +38.2% 0.72x
DropFirstAnySeqCntRangeLazy 43653 60309 +38.2% 0.72x
DropLastAnyCollection 10935 15105 +38.1% 0.72x
DropLastAnySequence 9265 12796 +38.1% 0.72x
StringComparison_longSharedPrefix 2289 3161 +38.1% 0.72x (?)
Set.isSubset.Seq.Box0 6657 9190 +38.1% 0.72x
WordCountUniqueASCII 7890 10890 +38.0% 0.72x
Set.isSuperset.Seq.Int50 2103 2902 +38.0% 0.72x
Breadcrumbs.UTF16ToIdx.longMixed 1360 1874 +37.8% 0.73x
Set.filter.Int100.24k 2861 3941 +37.7% 0.73x
StringComparison_fastPrenormal 6280 8650 +37.7% 0.73x
ParseInt.UIntSmall.Binary 20097 27680 +37.7% 0.73x
SuffixAnySeqCRangeIterLazy 48036 66088 +37.6% 0.73x
AngryPhonebook.ASCII2.Small 941 1294 +37.5% 0.73x
Chars2 38700 53150 +37.3% 0.73x
FlattenListLoop 68646 94233 +37.3% 0.73x
SuffixAnySeqCntRangeLazy 48070 65950 +37.2% 0.73x
Histogram 5378 7372 +37.1% 0.73x
ObjectAllocation 1171 1605 +37.1% 0.73x (?)
Set.filter.Int100.20k 2432 3331 +37.0% 0.73x (?)
FlattenListFlatMap 170176 233014 +36.9% 0.73x
StringComparison_latin1 4862 6656 +36.9% 0.73x (?)
WordCountUniqueUTF16 8090 11070 +36.8% 0.73x
SetSymmetricDifferenceInt50 535 730 +36.4% 0.73x
DropLastAnySequenceLazy 9696 13213 +36.3% 0.73x
PrefixArrayLazy 62815 85533 +36.2% 0.73x
DropFirstArrayLazy 62231 84728 +36.2% 0.73x
DropLastAnyCollectionLazy 45627 62071 +36.0% 0.74x
DropLastArrayLazy 20970 28503 +35.9% 0.74x
Set.isStrictSubset.Seq.Box25 7142 9698 +35.8% 0.74x
AngryPhonebook 2156 2926 +35.7% 0.74x
SetSymmetricDifferenceInt25 544 738 +35.7% 0.74x
Set.isDisjoint.Seq.Int25 3218 4359 +35.5% 0.74x
SuffixArrayLazy 20738 28084 +35.4% 0.74x
Set.subtracting.Seq.Int100 5377 7276 +35.3% 0.74x
Set.isSubset.Seq.Box25 7167 9696 +35.3% 0.74x
FloatingPointPrinting_Float80_interpolated 67000 90600 +35.2% 0.74x (?)
PrefixCountableRangeLazy 80540 108869 +35.2% 0.74x
RangeOverlapsRange 17657 23865 +35.2% 0.74x
FilterEvenUsingReduceInto 2339 3161 +35.1% 0.74x
StringHashing_ascii 259 350 +35.1% 0.74x
DropWhileAnyCollection 43980 59410 +35.1% 0.74x
DropFirstAnyCollection 33591 45339 +35.0% 0.74x
Set.filter.Int100.16k 2046 2761 +34.9% 0.74x
Set.isDisjoint.Seq.Int0 4321 5830 +34.9% 0.74x
ClosedRangeOverlapsClosedRange 17649 23808 +34.9% 0.74x
DropFirstAnyCollectionLazy 137856 185945 +34.9% 0.74x
LazilyFilteredArrays2 90300 121600 +34.7% 0.74x
Breadcrumbs.UTF16ToIdxRange.longASCII 226 304 +34.5% 0.74x
Set.isDisjoint.Seq.Int50 2171 2919 +34.5% 0.74x
DictionaryGroup 6485 8717 +34.4% 0.74x
SuffixCountableRangeLazy 26764 35975 +34.4% 0.74x
DropFirstCountableRangeLazy 80653 108304 +34.3% 0.74x
Set.subtracting.Seq.Int50 4936 6627 +34.3% 0.74x
Prims.NonStrongRef.Unmanaged 1068 1433 +34.2% 0.75x (?)
NSStringConversion.MutableCopy.UTF8 690 925 +34.1% 0.75x
SequenceAlgosList 6630 8880 +33.9% 0.75x
Set.subtracting.Seq.Int25 4734 6337 +33.9% 0.75x
DropLastCountableRangeLazy 26970 36095 +33.8% 0.75x
StringComparison_emoji 2072 2772 +33.8% 0.75x
BucketSort 8686 11602 +33.6% 0.75x
CSVParsing.Char 590 788 +33.6% 0.75x
Dictionary2 820 1095 +33.5% 0.75x
Diffing.Disparate 164 219 +33.5% 0.75x
Set.filter.Int100.28k 3733 4984 +33.5% 0.75x
StringComparison_slowerPrenormal 4250 5670 +33.4% 0.75x (?)
StringEdits 119800 159700 +33.3% 0.75x (?)
SuperChars2 1538 2050 +33.3% 0.75x
Set.subtracting.Seq.Int0 4487 5976 +33.2% 0.75x
Prims.NonStrongRef.Unmanaged.Closure 1081 1439 +33.1% 0.75x
PrefixAnyCollectionLazy 140571 187053 +33.1% 0.75x
Prims.NonStrongRef.UnmanagedUGR 1179 1566 +32.8% 0.75x (?)
Prims.NonStrongRef.UnmanagedUGR.Closure 1180 1564 +32.5% 0.75x
ErrorHandling 5390 7140 +32.5% 0.75x
RemoveWhereQuadraticInts 9983 13194 +32.2% 0.76x
DropWhileArray 14946 19745 +32.1% 0.76x
PrefixWhileAnyCollection 65875 86984 +32.0% 0.76x
StringComparison_nonBMPSlowestPrenormal 3780 4990 +32.0% 0.76x
Dictionary 2110 2780 +31.8% 0.76x (?)
StringBuilderWithLongSubstring 1860 2450 +31.7% 0.76x
Breadcrumbs.CopyUTF16CodeUnits.ASCII 124 163 +31.5% 0.76x
SetUnion 6060 7930 +30.9% 0.76x
SetUnionInt0 606 793 +30.9% 0.76x
DictOfArraysToArrayOfDicts 2505 3264 +30.3% 0.77x
SetIntersectionInt100 609 790 +29.7% 0.77x
EqualSubstringSubstring 27 35 +29.6% 0.77x
Set.intersection.Seq.Box0 1720 2229 +29.6% 0.77x (?)
Set.filter.Int50.24k 1750 2264 +29.4% 0.77x
RemoveWhereQuadraticStrings 10992 14220 +29.4% 0.77x
MapReduceSequence 25740 33255 +29.2% 0.77x
Set.filter.Int50.20k 1484 1914 +29.0% 0.78x
PrefixWhileCountableRange 31926 41082 +28.7% 0.78x
ArrayPlusEqualThreeElements 4810 6180 +28.5% 0.78x
DictionaryRemove 9110 11700 +28.4% 0.78x
COWTree 6900 8860 +28.4% 0.78x
Set.isDisjoint.Seq.Box25 4128 5284 +28.0% 0.78x
Set.filter.Int50.16k 1241 1585 +27.7% 0.78x (?)
NormalizedIterator_ascii 316 403 +27.5% 0.78x
FindString.Rec3.Array 8699 11080 +27.4% 0.79x
Set.isDisjoint.Box25 1712 2179 +27.3% 0.79x
Set.intersection.Seq.Box25 2046 2602 +27.2% 0.79x
Breadcrumbs.IdxToUTF16.longMixed 1797 2285 +27.2% 0.79x (?)
Set.filter.Int50.28k 2243 2849 +27.0% 0.79x (?)
SetSubtractingInt100 373 473 +26.8% 0.79x
Diffing.Myers.Similar 470 596 +26.8% 0.79x
ParseFloat.Double.Exp 30 38 +26.7% 0.79x (?)
ParseFloat.Float.Exp 30 38 +26.7% 0.79x (?)
Set.subtracting.Seq.Box0 5828 7379 +26.6% 0.79x
Set.isDisjoint.Seq.Box0 5684 7194 +26.6% 0.79x
StringComparison_abnormal 1280 1620 +26.6% 0.79x
Prims.NonStrongRef.UnownedUnsafe.Closure 1333 1685 +26.4% 0.79x
Set.isSuperset.Seq.Box25 1485 1875 +26.3% 0.79x (?)
SubstringEqualString 1390 1755 +26.3% 0.79x
Prims.NonStrongRef.UnownedUnsafe 1327 1673 +26.1% 0.79x
EqualSubstringSubstringGenericEquatable 27 34 +25.9% 0.79x
LessSubstringSubstringGenericComparable 27 34 +25.9% 0.79x (?)
SetSymmetricDifferenceInt0 765 961 +25.6% 0.80x
MapReduceShort 41060 51570 +25.6% 0.80x
SetExclusiveOr 7660 9610 +25.5% 0.80x (?)
SortAdjacentIntPyramids 82550 103550 +25.4% 0.80x (?)
RandomTree.insert.Unmanaged.fast 497 622 +25.2% 0.80x
FilterEvenUsingReduce 3430 4290 +25.1% 0.80x (?)
DropWhileCountableRange 10910 13641 +25.0% 0.80x (?)
LessSubstringSubstring 28 35 +25.0% 0.80x
EqualStringSubstring 28 35 +25.0% 0.80x
MapReduceAnyCollectionShort 40610 50720 +24.9% 0.80x
Set.subtracting.Seq.Box25 6666 8306 +24.6% 0.80x
NormalizedIterator_latin1 518 644 +24.3% 0.80x (?)
StringHashing_latin1 512 636 +24.2% 0.81x
FloatingPointPrinting_Float_interpolated 50000 62000 +24.0% 0.81x
MapReduceClassShort2 4316 5348 +23.9% 0.81x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5450 6750 +23.9% 0.81x (?)
Breadcrumbs.UTF16ToIdxRange.longMixed 323 399 +23.5% 0.81x
SetIntersectionInt50 383 473 +23.5% 0.81x
MapReduceNSDecimalNumberShort 4473 5520 +23.4% 0.81x (?)
FloatingPointPrinting_Double_interpolated 52800 65000 +23.1% 0.81x (?)
Breadcrumbs.CopyUTF16CodeUnits.Mixed 167 205 +22.8% 0.81x
ObserverForwarderStruct 3585 4390 +22.5% 0.82x (?)
TypeFlood 144 176 +22.2% 0.82x (?)
DictionaryOfAnyHashableStrings_insert 4676 5712 +22.2% 0.82x
ObjectiveCBridgeFromNSSetAnyObjectForced 3080 3760 +22.1% 0.82x (?)
SetIsSubsetBox0 582 710 +22.0% 0.82x
Set.isStrictSubset.Box0 587 715 +21.8% 0.82x
ParseInt.UInt64.Hex 4939 6006 +21.6% 0.82x
EqualSubstringString 28 34 +21.4% 0.82x
DictionaryBridgeToObjC_Bridge 14 17 +21.4% 0.82x
DataToStringSmall 2350 2850 +21.3% 0.82x (?)
ParseInt.UInt64.Decimal 5449 6596 +21.0% 0.83x (?)
PrefixWhileArray 22920 27728 +21.0% 0.83x
ArrayValueProp 2415 2920 +20.9% 0.83x
ArrayLiteral2 1188 1435 +20.8% 0.83x
Diffing.ReversedLorem 1132 1367 +20.8% 0.83x (?)
Diffing.PangramToAlphabet 1137 1371 +20.6% 0.83x (?)
CStringShortAscii 3840 4630 +20.6% 0.83x
MapReduceAnyCollection 37382 45061 +20.5% 0.83x
Prims.NonStrongRef.UnownedSafe 1845 2217 +20.2% 0.83x
MapReduce 37468 45007 +20.1% 0.83x
Prims.NonStrongRef.UnownedSafe.Closure 1863 2231 +19.8% 0.84x
String.data.LargeUnicode 72 86 +19.4% 0.84x (?)
StringToDataEmpty 1050 1250 +19.0% 0.84x
SuffixAnySequence 8568 10190 +18.9% 0.84x (?)
PrimsSplit 3765 4470 +18.7% 0.84x
StackPromo 37700 44700 +18.6% 0.84x
MapReduceClass2 3966 4702 +18.6% 0.84x
ArrayInitFromSlice 281 333 +18.5% 0.84x
ArrayValueProp4 2812 3332 +18.5% 0.84x
SuffixSequence 8580 10150 +18.3% 0.85x (?)
Prims 3775 4465 +18.3% 0.85x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 49500 58500 +18.2% 0.85x (?)
StringToDataSmall 1100 1300 +18.2% 0.85x (?)
ParseFloat.Float.Uniform 44 52 +18.2% 0.85x
SuffixSequenceLazy 8590 10147 +18.1% 0.85x
MapReduceNSDecimalNumber 4130 4866 +17.8% 0.85x
RandomShuffleLCG2 40624 47808 +17.7% 0.85x
DictionarySwap 3056 3596 +17.7% 0.85x (?)
SuffixAnySequenceLazy 8933 10506 +17.6% 0.85x
SetUnionBox25 995 1162 +16.8% 0.86x
RandomTree.insert.ADT 765 893 +16.7% 0.86x
SetSubtractingInt50 305 356 +16.7% 0.86x
DictionaryGroupOfObjects 5850 6804 +16.3% 0.86x (?)
SortIntPyramid 80025 93050 +16.3% 0.86x (?)
ObjectiveCBridgeFromNSStringForced 1540 1790 +16.2% 0.86x (?)
ArrayValueProp3 2918 3391 +16.2% 0.86x (?)
DictionaryLiteral 4270 4950 +15.9% 0.86x
SetIntersectionInt25 273 316 +15.8% 0.86x
ObjectiveCBridgeStubFromArrayOfNSString2 1810 2090 +15.5% 0.87x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4460 5140 +15.2% 0.87x (?)
StringHashing_fastPrenormal 940 1080 +14.9% 0.87x
DictionaryOfAnyHashableStrings_lookup 3096 3552 +14.7% 0.87x (?)
Breadcrumbs.IdxToUTF16Range.longMixed 633 726 +14.7% 0.87x
String.data.Medium 69 79 +14.5% 0.87x (?)
Dict.CopyKeyValue.24k 3904 4469 +14.5% 0.87x (?)
NormalizedIterator_fastPrenormal 970 1110 +14.4% 0.87x (?)
Dict.CopyKeyValue.20k 3320 3797 +14.4% 0.87x (?)
ObserverClosure 5440 6210 +14.2% 0.88x (?)
ObjectiveCBridgeFromNSString 1770 2020 +14.1% 0.88x (?)
DictionaryOfObjects 4525 5160 +14.0% 0.88x (?)
FindString.Loop1.Array 193069 220058 +14.0% 0.88x (?)
ObserverUnappliedMethod 6050 6890 +13.9% 0.88x (?)
NormalizedIterator_slowerPrenormal 870 990 +13.8% 0.88x (?)
Dict.CopyKeyValue.16k 2779 3160 +13.7% 0.88x (?)
ParseFloat.Double.Uniform 59 67 +13.6% 0.88x (?)
SetSymmetricDifferenceBox25 1372 1557 +13.5% 0.88x
ParseFloat.Float80.Exp 52 59 +13.5% 0.88x (?)
Dict.CopyKeyValue.28k 5088 5743 +12.9% 0.89x (?)
TwoSum 2370 2674 +12.8% 0.89x
AnyHashableWithAClass 86500 97500 +12.7% 0.89x (?)
StringHashing_slowerPrenormal 870 980 +12.6% 0.89x (?)
UTF8Decode_InitFromCustom_contiguous_ascii 228 256 +12.3% 0.89x (?)
CharacterLiteralsLarge 338 379 +12.1% 0.89x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 26600 29800 +12.0% 0.89x (?)
PlistPerfDecode 193 216 +11.9% 0.89x (?)
DataToStringMedium 4250 4750 +11.8% 0.89x (?)
Dictionary2OfObjects 2630 2935 +11.6% 0.90x (?)
RandomTree.insert.Unmanaged.slow 423 472 +11.6% 0.90x (?)
ObserverPartiallyAppliedMethod 5560 6200 +11.5% 0.90x (?)
Dictionary3 373 415 +11.3% 0.90x (?)
SetUnionBox0 1734 1917 +10.6% 0.90x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 26600 29400 +10.5% 0.90x (?)
SetUnion_OfObjects 17350 19170 +10.5% 0.91x (?)
SetSubtractingInt25 264 291 +10.2% 0.91x (?)
StringInterpolation 7900 8700 +10.1% 0.91x (?)
StringAdder 395 435 +10.1% 0.91x (?)
NormalizedIterator_emoji 1040 1144 +10.0% 0.91x (?)
JSONPerfDecode 190 209 +10.0% 0.91x (?)
RemoveWhereSwapStrings 6912 7600 +10.0% 0.91x (?)
Dictionary4 615 676 +9.9% 0.91x (?)
RemoveWhereSwapInts 6079 6679 +9.9% 0.91x
NormalizedIterator_nonBMPSlowestPrenormal 1320 1450 +9.8% 0.91x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 46000 50500 +9.8% 0.91x (?)
DataToStringLargeUnicode 5200 5700 +9.6% 0.91x (?)
Diffing.Similar 358 392 +9.5% 0.91x (?)
StringHashing_emoji 1024 1120 +9.4% 0.91x (?)
RandomShuffleDef2 6260 6840 +9.3% 0.92x (?)
DataCreateSmallArray 55700 60750 +9.1% 0.92x (?)
StaticArray 712 773 +8.6% 0.92x (?)
StringHashing_nonBMPSlowestPrenormal 1310 1420 +8.4% 0.92x (?)
Diffing.Pangrams 3161 3414 +8.0% 0.93x (?)
SequenceAlgosUnfoldSequence 2630 2840 +8.0% 0.93x (?)
Dictionary4Legacy 767 828 +8.0% 0.93x (?)
Dictionary3OfObjects 1008 1087 +7.8% 0.93x (?)
Dictionary4OfObjects 900 970 +7.8% 0.93x (?)
WordCountHistogramASCII 89000 95700 +7.5% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayOfPOD 730 647 -11.4% 1.13x (?)
ArrayOfGenericPOD2 570 509 -10.7% 1.12x (?)
ObjectiveCBridgeStringHash 86 78 -9.3% 1.10x (?)

Code size: -swiftlibs

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 mini
  Model Identifier: Macmini8,1
  Processor Name: 6-Core Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

@dabrahams
Copy link
Contributor Author

dabrahams commented May 9, 2020

OK, the real reproducer is attached to https://bugs.swift.org/browse/SR-12760 and the other bug is filed as https://bugs.swift.org/browse/SR-12761

@@ -684,6 +687,7 @@ MetadataResponse
swift::swift_getGenericMetadata(MetadataRequest request,
const void * const *arguments,
const TypeContextDescriptor *description) {
std::lock_guard<std::recursive_mutex> guard(metadata_mutex);
Copy link
Contributor

Choose a reason for hiding this comment

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

We didn't just forget to add a lock here. If there's something wrong with our current implementation, we should figure it out, but grabbing a lock at the start of a bunch of runtime functions that are meant to work without locks is not acceptable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rjmccall Hey, we know. We're just trying to get the problem on everybody's radar. How these functions are “meant to work” is not immediately obvious from the comments, and I guess some other people around here probably do understand that. If someone would like to explain that, we might be able to attempt an acceptable fix. We won't be insulted either if this PR is closed and replaced with one that is acceptable. 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, this is a pretty aggressive way of reporting a bug.

I opened #31768 for the associated-witness issue, which should fix Parker's bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow, man, no offense intended. I thought such a bug in the runtime (which I presume to be a security issue) might be important enough that y'all might be interested in a quick fix. I don't know what you think is aggressive about it. Just trying to be helpful, here. Next time I'll stick to Jira.

Copy link
Contributor

Choose a reason for hiding this comment

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

No offense taken; I'm just trying to explain that this is not, in fact, a working quick fix.

Please CC me on any concurrency bugs you file; we definitely want to treat them as high-priority.

@rjmccall
Copy link
Contributor

rjmccall commented May 11, 2020

TSan is right to report about swift_getAssociatedTypeWitness / swift_getAssociatedTypeWitnessSlowImpl; the loads and stores from the witness table need to be atomic (acquire/release, respectively). Tsk, @DougGregor. :)

Our metadata usage should actually be fine with the loads being consume, but the compiler doesn't really know how to optimize that.

@dabrahams
Copy link
Contributor Author

Closing in favor of #31768

@dabrahams dabrahams closed this May 22, 2020
@dabrahams dabrahams deleted the metadata-cache-thread-safety branch September 22, 2020 15:46
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.

7 participants