Skip to content

[stdlib] Add faster 32-bit and 64-bit binade, nextUp, ulp #15021

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

Merged
merged 2 commits into from
Mar 7, 2018
Merged

[stdlib] Add faster 32-bit and 64-bit binade, nextUp, ulp #15021

merged 2 commits into from
Mar 7, 2018

Conversation

xwu
Copy link
Collaborator

@xwu xwu commented Mar 6, 2018

The performance of binade, nextUp, and ulp can be improved for concrete types, and potentially by quite a bit.

Here, the bit pattern of 32-bit and 64-bit values is directly manipulated to produce the desired result. As Float80 values do not have a bitPattern property (and do not use an implicit leading bit), similar manipulations require separate implementations not incorporated here; instead, the previous algorithms are preserved for that type.

Resolves SR-6960.

@xwu
Copy link
Collaborator Author

xwu commented Mar 6, 2018

@swift-ci Please smoke benchmark

@xwu xwu changed the title [stdlib] Add faster 32-bit and 64-bit binade, nextUp, ulp [WIP] [stdlib] Add faster 32-bit and 64-bit binade, nextUp, ulp Mar 6, 2018
@xwu xwu requested a review from stephentyrone March 6, 2018 22:19
guard _fastPath(isFinite) else { return .nan }
if _fastPath(isNormal) {
let bitPattern_ = bitPattern & ${Self}.infinity.bitPattern
return ${Self}(bitPattern: bitPattern_) / 0x1p${SignificandBitCount}
Copy link
Contributor

@stephentyrone stephentyrone Mar 6, 2018

Choose a reason for hiding this comment

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

I would tend to write this as * 0x1p-${SignificandBitCount} because I think of it that way, but there shouldn't be any perf difference, since llvm knows how to optimize a known power-of-two divide into a multiply. Probably worth checking that this optimization happens even at -Onone to be safe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. For greatest certainty, I'll just write it out. It's just as clear to the reader in any case.

// On arm, skip positive subnormal values.
if _slowPath(x.bitPattern & (-${Self}.infinity).bitPattern == 0) {
return .leastNormalMagnitude
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The way this is implemented for arm worries me. I would do:

if (x == 0) {
  return .leastNonzeroMagnitude
}

There's no formal logic in IEEE 754 for flushing subnormals, so there's no real spec to go off of, but I prefer to think of them as non-canonical encodings of zero. Implementing them as I describe here does that, and also has the happy side-effect of working correctly for free if someone makes an arm32 platform where subnormals are supported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like that interpretation. It does change existing behavior though, as negative subnormal values currently have nextUp evaluating to -0 on arm32. But if you're fine with changing the interpretation, I do like the new way better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think that it's the only semi-coherent way to make sense of these cases.

let increment = Int${bits}(bitPattern: x.bitPattern) &>> ${bits - 1} | 1
let bitPattern_ = x.bitPattern &+ UInt${bits}(bitPattern: increment)
#if arch(arm)
// On arm, flush negative subnormal values to -0.
Copy link
Contributor

Choose a reason for hiding this comment

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

If you follow my suggestion above, you can eliminate this, since all subnormals will have already been handled.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The subnormal result of incrementing -.leastNormalMagnitude still needs to be flushed to -0, but that can be written differently and in a way that is future-proof.

Copy link
Contributor

Choose a reason for hiding this comment

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

It should fall out for free. 1 will be subtracted from the bit pattern, which will produce a negative subnormal, which will be treated as zero by whatever consumes it (as a "non canonical encoding of zero"). Or am I missing something?

Copy link
Collaborator Author

@xwu xwu Mar 7, 2018

Choose a reason for hiding this comment

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

Well, it's defensible since it's technically correct, but I think it'd be rather more elegant not to produce the negative subnormal in the first place; the end user may inspect its bit pattern and we might as well give a canonical encoding of negative zero because we're nice. The cost to doing so would be minimal and it can be future-proof too.

[Edit: ...and the symmetry of the conditional statements is so darn satisfying to look at.]

Copy link
Contributor

Choose a reason for hiding this comment

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

ok.

@@ -625,7 +625,20 @@ extension ${Self}: BinaryFloatingPoint {
/// almost never is.
@_inlineable // FIXME(sil-serialize-all)
public var ulp: ${Self} {
if !isFinite { return ${Self}.nan }
%if bits == 32 or bits == 64:
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use bits != 80 for all of these instead of == 32 or ==64 so that we get the fast implementation for hypothetical future Float16 / Float128 automatically.

@swift-ci
Copy link
Contributor

swift-ci commented Mar 6, 2018

Build comment file:

Optimized (O)

Regression (2)
TEST OLD NEW DELTA SPEEDUP
StringHasPrefixAscii 1024 1153 +12.6% 0.89x
RemoveWhereMoveInts 17 18 +5.9% 0.94x
Improvement (58)
TEST OLD NEW DELTA SPEEDUP
BinaryFloatingPointPropertiesNextUp 148 25 -83.1% 5.92x
BinaryFloatingPointPropertiesBinade 87 27 -69.0% 3.22x
BinaryFloatingPointPropertiesUlp 84 33 -60.7% 2.55x
CStringLongAscii 5061 4005 -20.9% 1.26x
CSVParsingAlt 877176 728029 -17.0% 1.20x
CharIndexing_ascii_unicodeScalars 15571 13207 -15.2% 1.18x
CharIndexing_punctuated_unicodeScalars 3594 3054 -15.0% 1.18x
CharIteration_tweet_unicodeScalars_Backwards 29629 25195 -15.0% 1.18x
Calculator 622 529 -15.0% 1.18x
CharIndexing_chinese_unicodeScalars 11751 10024 -14.7% 1.17x
CharIndexing_japanese_unicodeScalars 18518 15803 -14.7% 1.17x
COWTree 6643 5671 -14.6% 1.17x
CharIndexing_korean_unicodeScalars_Backwards 14551 12429 -14.6% 1.17x
CharIndexing_russian_unicodeScalars_Backwards 12520 10695 -14.6% 1.17x
CharIndexing_chinese_unicodeScalars_Backwards 11382 9731 -14.5% 1.17x
CharIndexing_punctuatedJapanese_unicodeScalars 2876 2459 -14.5% 1.17x
CharacterLiteralsLarge 7177 6152 -14.3% 1.17x
CharIndexing_ascii_unicodeScalars_Backwards 14954 12820 -14.3% 1.17x
CStringShortAscii 5503 4757 -13.6% 1.16x
CharIteration_tweet_unicodeScalars 43637 37930 -13.1% 1.15x
CharIndexing_utf16_unicodeScalars 22289 19719 -11.5% 1.13x
CharacterLiteralsSmall 460 409 -11.1% 1.12x
CSVParsing 866342 771289 -11.0% 1.12x
CharIteration_punctuated_unicodeScalars_Backwards 3280 2943 -10.3% 1.11x
CharIndexing_punctuated_unicodeScalars_Backwards 3286 2971 -9.6% 1.11x
ArrayAppendUTF16 37427 34075 -9.0% 1.10x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2624 2397 -8.7% 1.09x
CharIndexing_russian_unicodeScalars 12045 11019 -8.5% 1.09x
CharIteration_punctuated_unicodeScalars 4736 4343 -8.3% 1.09x
CharIteration_ascii_unicodeScalars 20969 19231 -8.3% 1.09x
CharIndexing_tweet_unicodeScalars 28291 25984 -8.2% 1.09x
MapReduce 362 333 -8.0% 1.09x
CharIndexing_japanese_unicodeScalars_Backwards 16636 15327 -7.9% 1.09x
ArrayPlusEqualFiveElementCollection 6245 5770 -7.6% 1.08x
MapReduceAnyCollection 395 365 -7.6% 1.08x
RemoveWhereFilterInts 42 39 -7.1% 1.08x
CharIteration_chinese_unicodeScalars 15628 14535 -7.0% 1.08x
Array2D 2241 2092 -6.6% 1.07x
AnyHashableWithAClass 80688 75439 -6.5% 1.07x
AngryPhonebook 4073 3810 -6.5% 1.07x
ArrayOfGenericRef 4784 4489 -6.2% 1.07x
CharIteration_ascii_unicodeScalars_Backwards 13576 12779 -5.9% 1.06x
ArrayOfRef 4753 4475 -5.8% 1.06x
ArrayPlusEqualThreeElements 1830 1723 -5.8% 1.06x
CharIndexing_utf16_unicodeScalars_Backwards 21630 20366 -5.8% 1.06x
CharIteration_korean_unicodeScalars_Backwards 13132 12390 -5.7% 1.06x
ByteSwap 124 117 -5.6% 1.06x
PrefixWhileSequence 338 319 -5.6% 1.06x
ArrayAppendLazyMap 1028 971 -5.5% 1.06x
ObjectiveCBridgeStubToNSDate 15987 15103 -5.5% 1.06x
ArrayAppendOptionals 1370 1295 -5.5% 1.06x
ObjectiveCBridgeStubFromNSString 770 730 -5.2% 1.05x
ArrayAppendSequence 891 845 -5.2% 1.05x
CharIteration_russian_unicodeScalars_Backwards 11237 10658 -5.2% 1.05x
StringWithCString 35235 33447 -5.1% 1.05x
ArrayAppendGenericStructs 1346 1279 -5.0% 1.05x
ArrayAppendRepeatCol 1096 1042 -4.9% 1.05x
CharIteration_utf16_unicodeScalars 28847 27435 -4.9% 1.05x
No Changes (321)
TEST OLD NEW DELTA SPEEDUP
ArrayAppend 1060 1019 -3.9% 1.04x
ArrayAppendArrayOfInt 650 631 -2.9% 1.03x
ArrayAppendAscii 11894 11344 -4.6% 1.05x
ArrayAppendFromGeneric 649 629 -3.1% 1.03x
ArrayAppendLatin1 38422 36981 -3.8% 1.04x
ArrayAppendReserved 797 774 -2.9% 1.03x
ArrayAppendStrings 16091 15388 -4.4% 1.05x
ArrayAppendToFromGeneric 647 628 -2.9% 1.03x
ArrayAppendToGeneric 650 630 -3.1% 1.03x
ArrayInClass 68 66 -2.9% 1.03x (?)
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD2 149 146 -2.0% 1.02x
ArrayOfPOD 175 169 -3.4% 1.04x
ArrayPlusEqualArrayOfInt 657 629 -4.3% 1.04x
ArrayPlusEqualSingleElementCollection 1059 1017 -4.0% 1.04x
ArraySubscript 1572 1512 -3.8% 1.04x
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
BinaryFloatingPointConversionFromBinaryInteger 33 32 -3.0% 1.03x
BitCount 155 162 +4.5% 0.96x
CSVParsingAltIndices 382018 379074 -0.8% 1.01x
CStringLongNonAscii 1884 1889 +0.3% 1.00x (?)
CaptureProp 4251 4184 -1.6% 1.02x
CharIndexing_korean_unicodeScalars 12877 12814 -0.5% 1.00x
CharIndexing_tweet_unicodeScalars_Backwards 26022 25216 -3.1% 1.03x (?)
CharIteration_chinese_unicodeScalars_Backwards 9803 9694 -1.1% 1.01x
CharIteration_japanese_unicodeScalars 23023 23009 -0.1% 1.00x (?)
CharIteration_japanese_unicodeScalars_Backwards 15292 15288 -0.0% 1.00x
CharIteration_korean_unicodeScalars 18598 18622 +0.1% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars 3460 3462 +0.1% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2358 2365 +0.3% 1.00x (?)
CharIteration_russian_unicodeScalars 16279 16004 -1.7% 1.02x
CharIteration_utf16_unicodeScalars_Backwards 16172 16320 +0.9% 0.99x (?)
CharacterPropertiesFetch 4748 4682 -1.4% 1.01x
CharacterPropertiesPrecomputed 1041 1042 +0.1% 1.00x (?)
CharacterPropertiesStashed 1494 1501 +0.5% 1.00x (?)
CharacterPropertiesStashedMemo 1483 1487 +0.3% 1.00x (?)
Chars 712 712 +0.0% 1.00x
ClassArrayGetter 13 13 +0.0% 1.00x
Combos 478 474 -0.8% 1.01x (?)
DictOfArraysToArrayOfDicts 792 797 +0.6% 0.99x (?)
Dictionary 495 494 -0.2% 1.00x (?)
Dictionary2 1631 1643 +0.7% 0.99x
Dictionary2OfObjects 3002 3016 +0.5% 1.00x
Dictionary3 234 234 +0.0% 1.00x
Dictionary3OfObjects 700 694 -0.9% 1.01x
Dictionary4 143 143 +0.0% 1.00x
Dictionary4OfObjects 201 201 +0.0% 1.00x
DictionaryBridge 1651 1643 -0.5% 1.00x (?)
DictionaryGroup 131 130 -0.8% 1.01x (?)
DictionaryGroupOfObjects 1971 1968 -0.2% 1.00x
DictionaryLiteral 1606 1607 +0.1% 1.00x
DictionaryOfObjects 2224 2210 -0.6% 1.01x
DictionaryRemove 2737 2734 -0.1% 1.00x (?)
DictionaryRemoveOfObjects 24479 24475 -0.0% 1.00x (?)
DictionarySubscriptDefaultMutation 143 142 -0.7% 1.01x (?)
DictionarySubscriptDefaultMutationArray 516 516 +0.0% 1.00x
DictionarySubscriptDefaultMutationArrayOfObjects 3912 3914 +0.1% 1.00x (?)
DictionarySubscriptDefaultMutationOfObjects 1423 1423 +0.0% 1.00x
DictionarySwap 447 446 -0.2% 1.00x (?)
DictionarySwapOfObjects 7683 7642 -0.5% 1.01x (?)
DoubleWidthDivision 0 0 +0.0% 1.00x
DropFirstAnyCollection 70 70 +0.0% 1.00x
DropFirstAnyCollectionLazy 70603 70394 -0.3% 1.00x (?)
DropFirstAnySeqCRangeIter 19696 19775 +0.4% 1.00x
DropFirstAnySeqCRangeIterLazy 19682 19767 +0.4% 1.00x
DropFirstAnySeqCntRange 62 62 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 62 62 +0.0% 1.00x
DropFirstAnySequence 5075 5068 -0.1% 1.00x
DropFirstAnySequenceLazy 5073 5072 -0.0% 1.00x (?)
DropFirstArray 30 30 +0.0% 1.00x
DropFirstArrayLazy 30 30 +0.0% 1.00x
DropFirstCountableRange 18 18 +0.0% 1.00x
DropFirstCountableRangeLazy 18 18 +0.0% 1.00x
DropFirstSequence 2665 2666 +0.0% 1.00x (?)
DropFirstSequenceLazy 2865 2866 +0.0% 1.00x (?)
DropLastAnyCollection 31 30 -3.2% 1.03x (?)
DropLastAnyCollectionLazy 23563 23635 +0.3% 1.00x (?)
DropLastAnySeqCRangeIter 3787 3773 -0.4% 1.00x (?)
DropLastAnySeqCRangeIterLazy 3782 3753 -0.8% 1.01x
DropLastAnySeqCntRange 22 22 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 22 23 +4.5% 0.96x
DropLastAnySequence 5259 5250 -0.2% 1.00x
DropLastAnySequenceLazy 5460 5452 -0.1% 1.00x (?)
DropLastCountableRange 6 6 +0.0% 1.00x
DropLastCountableRangeLazy 6 6 +0.0% 1.00x
DropLastSequence 544 527 -3.1% 1.03x
DropLastSequenceLazy 544 527 -3.1% 1.03x
DropWhileAnyCollection 83 83 +0.0% 1.00x
DropWhileAnyCollectionLazy 105 105 +0.0% 1.00x
DropWhileAnySeqCRangeIter 16471 16514 +0.3% 1.00x (?)
DropWhileAnySeqCRangeIterLazy 105 105 +0.0% 1.00x
DropWhileAnySeqCntRange 75 75 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 105 105 +0.0% 1.00x
DropWhileAnySequence 5961 6112 +2.5% 0.98x
DropWhileAnySequenceLazy 1966 1966 +0.0% 1.00x
DropWhileArrayLazy 78 78 +0.0% 1.00x
DropWhileCountableRange 19 19 +0.0% 1.00x
DropWhileCountableRangeLazy 70 70 +0.0% 1.00x
DropWhileSequence 1331 1330 -0.1% 1.00x (?)
DropWhileSequenceLazy 47 47 +0.0% 1.00x
EqualStringSubstring 43 42 -2.3% 1.02x
EqualSubstringString 43 42 -2.3% 1.02x
EqualSubstringSubstring 43 42 -2.3% 1.02x
EqualSubstringSubstringGenericEquatable 43 42 -2.3% 1.02x
ErrorHandling 2325 2383 +2.5% 0.98x
ExclusivityGlobal 3 3 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FilterEvenUsingReduce 1351 1346 -0.4% 1.00x (?)
FilterEvenUsingReduceInto 151 150 -0.7% 1.01x (?)
FrequenciesUsingReduce 6671 6688 +0.3% 1.00x
FrequenciesUsingReduceInto 3160 3166 +0.2% 1.00x (?)
Hanoi 3309 3437 +3.9% 0.96x
HashTest 1733 1725 -0.5% 1.00x (?)
Histogram 315 316 +0.3% 1.00x
Integrate 311 317 +1.9% 0.98x
IterateData 1284 1287 +0.2% 1.00x
Join 371 370 -0.3% 1.00x (?)
LazilyFilteredArrayContains 30872 32133 +4.1% 0.96x
LazilyFilteredArrays 67380 67250 -0.2% 1.00x (?)
LazilyFilteredRange 3477 3515 +1.1% 0.99x
LessSubstringSubstring 42 41 -2.4% 1.02x
LessSubstringSubstringGenericComparable 42 41 -2.4% 1.02x
LinkedList 8284 8330 +0.6% 0.99x (?)
LuhnAlgoEager 626 629 +0.5% 1.00x
LuhnAlgoLazy 626 629 +0.5% 1.00x (?)
MapReduceAnyCollectionShort 2328 2320 -0.3% 1.00x (?)
MapReduceClass 3051 3052 +0.0% 1.00x (?)
MapReduceClassShort 4622 4687 +1.4% 0.99x (?)
MapReduceLazyCollection 13 13 +0.0% 1.00x
MapReduceLazyCollectionShort 36 36 +0.0% 1.00x
MapReduceLazySequence 90 90 +0.0% 1.00x
MapReduceSequence 452 451 -0.2% 1.00x
MapReduceShort 2036 2044 +0.4% 1.00x
MapReduceShortString 21 21 +0.0% 1.00x
MapReduceString 72 72 +0.0% 1.00x
Memset 235 235 +0.0% 1.00x
MonteCarloE 10339 10361 +0.2% 1.00x
MonteCarloPi 44016 43994 -0.0% 1.00x
NSDictionaryCastToSwift 5499 5607 +2.0% 0.98x (?)
NSError 307 304 -1.0% 1.01x (?)
NSStringConversion 246 244 -0.8% 1.01x (?)
NibbleSort 3511 3511 +0.0% 1.00x
NopDeinit 21419 21393 -0.1% 1.00x
ObjectAllocation 187 188 +0.5% 0.99x (?)
ObjectiveCBridgeFromNSArrayAnyObject 18700 18582 -0.6% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 3741 3786 +1.2% 0.99x
ObjectiveCBridgeFromNSArrayAnyObjectToString 36572 36483 -0.2% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 32295 32207 -0.3% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 105365 106688 +1.3% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObject 55116 55070 -0.1% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 3978 3971 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 64654 64957 +0.5% 1.00x (?)
ObjectiveCBridgeFromNSString 1291 1289 -0.2% 1.00x
ObjectiveCBridgeFromNSStringForced 2118 2153 +1.7% 0.98x
ObjectiveCBridgeStubDataAppend 4113 4150 +0.9% 0.99x (?)
ObjectiveCBridgeStubDateMutation 272 272 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 23797 23780 -0.1% 1.00x (?)
ObjectiveCBridgeStubFromNSDate 3721 3615 -2.8% 1.03x
ObjectiveCBridgeStubFromNSStringRef 146 141 -3.4% 1.04x
ObjectiveCBridgeStubNSDataAppend 2366 2454 +3.7% 0.96x (?)
ObjectiveCBridgeStubNSDateMutationRef 16498 17064 +3.4% 0.97x (?)
ObjectiveCBridgeStubToArrayOfNSString 29013 29888 +3.0% 0.97x
ObjectiveCBridgeStubToNSDateRef 3597 3548 -1.4% 1.01x (?)
ObjectiveCBridgeStubToNSString 1589 1573 -1.0% 1.01x
ObjectiveCBridgeStubToNSStringRef 101 101 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 244474 243830 -0.3% 1.00x (?)
ObjectiveCBridgeStubURLAppendPathRef 243898 239738 -1.7% 1.02x (?)
ObjectiveCBridgeToNSArray 28949 29113 +0.6% 0.99x (?)
ObjectiveCBridgeToNSDictionary 42324 42998 +1.6% 0.98x
ObjectiveCBridgeToNSSet 36254 36479 +0.6% 0.99x (?)
ObjectiveCBridgeToNSString 1342 1333 -0.7% 1.01x
ObserverClosure 2169 2173 +0.2% 1.00x (?)
ObserverForwarderStruct 965 969 +0.4% 1.00x (?)
ObserverPartiallyAppliedMethod 3766 3781 +0.4% 1.00x (?)
ObserverUnappliedMethod 2430 2414 -0.7% 1.01x
OpenClose 105 109 +3.8% 0.96x
PartialApplyDynamicType 0 0 +0.0% 1.00x
Phonebook 3458 3522 +1.9% 0.98x
PointerArithmetics 33342 33353 +0.0% 1.00x (?)
PolymorphicCalls 17 17 +0.0% 1.00x
PopFrontArray 1235 1231 -0.3% 1.00x
PopFrontArrayGeneric 1249 1245 -0.3% 1.00x
PopFrontUnsafePointer 5954 5951 -0.1% 1.00x (?)
PrefixAnyCollection 70 70 +0.0% 1.00x
PrefixAnyCollectionLazy 70510 70846 +0.5% 1.00x (?)
PrefixAnySeqCRangeIter 15590 15677 +0.6% 0.99x
PrefixAnySeqCRangeIterLazy 15619 15673 +0.3% 1.00x (?)
PrefixAnySeqCntRange 62 62 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 62 62 +0.0% 1.00x
PrefixAnySequence 4457 4451 -0.1% 1.00x (?)
PrefixAnySequenceLazy 4452 4455 +0.1% 1.00x
PrefixArray 30 30 +0.0% 1.00x
PrefixArrayLazy 30 30 +0.0% 1.00x
PrefixCountableRange 19 19 +0.0% 1.00x
PrefixCountableRangeLazy 18 18 +0.0% 1.00x
PrefixSequence 1330 1331 +0.1% 1.00x
PrefixSequenceLazy 1479 1480 +0.1% 1.00x
PrefixWhileAnyCollection 108 107 -0.9% 1.01x
PrefixWhileAnyCollectionLazy 58 58 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 9422 9366 -0.6% 1.01x
PrefixWhileAnySeqCRangeIterLazy 67 67 +0.0% 1.00x
PrefixWhileAnySeqCntRange 100 100 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 58 58 +0.0% 1.00x
PrefixWhileAnySequence 10696 10695 -0.0% 1.00x (?)
PrefixWhileAnySequenceLazy 1476 1475 -0.1% 1.00x
PrefixWhileArray 74 74 +0.0% 1.00x
PrefixWhileArrayLazy 37 37 +0.0% 1.00x
PrefixWhileCountableRange 29 29 +0.0% 1.00x
PrefixWhileCountableRangeLazy 18 18 +0.0% 1.00x
PrefixWhileSequenceLazy 28 28 +0.0% 1.00x
Prims 776 771 -0.6% 1.01x (?)
PrimsSplit 787 796 +1.1% 0.99x (?)
QueueConcrete 1374 1371 -0.2% 1.00x (?)
QueueGeneric 1183 1178 -0.4% 1.00x
RC4 173 172 -0.6% 1.01x
RGBHistogram 2214 2217 +0.1% 1.00x (?)
RGBHistogramOfObjects 24388 24390 +0.0% 1.00x (?)
RangeAssignment 316 305 -3.5% 1.04x
RangeIterationSigned 135 135 +0.0% 1.00x
RangeIterationSigned64 155 156 +0.6% 0.99x (?)
RangeIterationUnsigned 151 152 +0.7% 0.99x (?)
RangeReplaceableCollectionPlusDefault 1000 1006 +0.6% 0.99x (?)
RecursiveOwnedParameter 2434 2419 -0.6% 1.01x
RemoveWhereFilterString 285 287 +0.7% 0.99x
RemoveWhereFilterStrings 435 436 +0.2% 1.00x (?)
RemoveWhereMoveStrings 527 525 -0.4% 1.00x (?)
RemoveWhereQuadraticInts 1213 1213 +0.0% 1.00x
RemoveWhereQuadraticString 177 177 +0.0% 1.00x
RemoveWhereQuadraticStrings 2926 2928 +0.1% 1.00x (?)
RemoveWhereSwapInts 18 18 +0.0% 1.00x
RemoveWhereSwapStrings 879 879 +0.0% 1.00x
ReversedArray 51 51 +0.0% 1.00x
ReversedBidirectional 17741 17826 +0.5% 1.00x (?)
ReversedDictionary 147 146 -0.7% 1.01x (?)
RomanNumbers 111339 114610 +2.9% 0.97x
SequenceAlgosAnySequence 11090 11077 -0.1% 1.00x
SequenceAlgosArray 1656 1650 -0.4% 1.00x (?)
SequenceAlgosContiguousArray 1674 1692 +1.1% 0.99x (?)
SequenceAlgosList 1511 1526 +1.0% 0.99x
SequenceAlgosRange 3335 3335 +0.0% 1.00x
SequenceAlgosUnfoldSequence 1089 1089 +0.0% 1.00x
SetExclusiveOr 3320 3278 -1.3% 1.01x (?)
SetExclusiveOr_OfObjects 9080 9175 +1.0% 0.99x
SetIntersect 317 319 +0.6% 0.99x
SetIntersect_OfObjects 1835 1835 +0.0% 1.00x
SetIsSubsetOf 306 307 +0.3% 1.00x
SetIsSubsetOf_OfObjects 376 374 -0.5% 1.01x
SetUnion 3063 3064 +0.0% 1.00x (?)
SetUnion_OfObjects 7412 7560 +2.0% 0.98x (?)
SevenBoom 1545 1540 -0.3% 1.00x (?)
Sim2DArray 354 354 +0.0% 1.00x
SortLargeExistentials 6814 6799 -0.2% 1.00x (?)
SortLettersInPlace 1153 1156 +0.3% 1.00x (?)
SortSortedStrings 869 895 +3.0% 0.97x
SortStrings 1660 1697 +2.2% 0.98x
SortStringsUnicode 2349 2422 +3.1% 0.97x
StackPromo 22375 22294 -0.4% 1.00x
StaticArray 7 7 +0.0% 1.00x
StrComplexWalk 1473 1475 +0.1% 1.00x (?)
StrToInt 1948 1967 +1.0% 0.99x
StringAdder 4319 4280 -0.9% 1.01x
StringBuilder 1394 1362 -2.3% 1.02x
StringBuilderLong 1046 1053 +0.7% 0.99x (?)
StringComparison_abnormal 743 751 +1.1% 0.99x
StringComparison_ascii 810 851 +5.1% 0.95x
StringComparison_emoji 790 792 +0.3% 1.00x (?)
StringComparison_fastPrenormal 653 664 +1.7% 0.98x (?)
StringComparison_latin1 533 523 -1.9% 1.02x
StringComparison_longSharedPrefix 684 703 +2.8% 0.97x (?)
StringComparison_nonBMPSlowestPrenormal 1533 1558 +1.6% 0.98x
StringComparison_slowerPrenormal 1645 1654 +0.5% 0.99x
StringComparison_zalgo 94032 95327 +1.4% 0.99x (?)
StringEdits 118400 117693 -0.6% 1.01x (?)
StringEnumRawValueInitialization 950 946 -0.4% 1.00x
StringEqualPointerComparison 272 272 +0.0% 1.00x
StringFromLongWholeSubstring 22 22 +0.0% 1.00x
StringFromLongWholeSubstringGeneric 10 10 +0.0% 1.00x
StringHasPrefixUnicode 26030 26079 +0.2% 1.00x (?)
StringHasSuffixAscii 1198 1221 +1.9% 0.98x
StringHasSuffixUnicode 73966 73858 -0.1% 1.00x (?)
StringInterpolation 10842 10857 +0.1% 1.00x (?)
StringMatch 6737 6873 +2.0% 0.98x
StringRemoveDupes 1218 1215 -0.2% 1.00x (?)
StringUTF16Builder 2405 2413 +0.3% 1.00x (?)
StringWalk 1504 1499 -0.3% 1.00x
StringWordBuilder 1557 1497 -3.9% 1.04x
StringWordBuilderReservingCapacity 1168 1132 -3.1% 1.03x
SubstringComparable 42 42 +0.0% 1.00x
SubstringEqualString 526 520 -1.1% 1.01x
SubstringEquatable 1354 1334 -1.5% 1.01x
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 71 71 +0.0% 1.00x
SuffixAnyCollection 33 33 +0.0% 1.00x
SuffixAnyCollectionLazy 23502 23520 +0.1% 1.00x (?)
SuffixAnySeqCRangeIter 4016 4024 +0.2% 1.00x
SuffixAnySeqCRangeIterLazy 4015 4018 +0.1% 1.00x (?)
SuffixAnySeqCntRange 25 25 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 25 25 +0.0% 1.00x
SuffixAnySequence 5281 5271 -0.2% 1.00x
SuffixAnySequenceLazy 5480 5469 -0.2% 1.00x
SuffixCountableRange 6 6 +0.0% 1.00x
SuffixCountableRangeLazy 6 6 +0.0% 1.00x
SuffixSequence 3774 3785 +0.3% 1.00x (?)
SuffixSequenceLazy 3792 3786 -0.2% 1.00x
SumUsingReduce 97 97 +0.0% 1.00x
SumUsingReduceInto 97 97 +0.0% 1.00x
SuperChars 43853 42515 -3.1% 1.03x (?)
TwoSum 1010 1008 -0.2% 1.00x
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 260 260 +0.0% 1.00x
Walsh 369 369 +0.0% 1.00x
WordCountHistogramASCII 6929 7063 +1.9% 0.98x
WordCountHistogramUTF16 21357 21712 +1.7% 0.98x (?)
WordCountUniqueASCII 1732 1739 +0.4% 1.00x
WordCountUniqueUTF16 15431 15510 +0.5% 0.99x (?)
WordSplitASCII 20150 20265 +0.6% 0.99x
WordSplitUTF16 21173 21228 +0.3% 1.00x (?)
XorLoop 352 352 +0.0% 1.00x

Unoptimized (Onone)

Regression (5)
TEST OLD NEW DELTA SPEEDUP
ArrayOfPOD 700 790 +12.9% 0.89x
PointerArithmetics 108477 117438 +8.3% 0.92x
StringComparison_latin1 4149 4380 +5.6% 0.95x (?)
OpenClose 485 511 +5.4% 0.95x
ObjectiveCBridgeStubToNSDate 15506 16333 +5.3% 0.95x (?)
Improvement (3)
TEST OLD NEW DELTA SPEEDUP
Memset 56209 45764 -18.6% 1.23x (?)
StringHasPrefixAscii 2849 2577 -9.5% 1.11x
TypeFlood 175 164 -6.3% 1.07x (?)
No Changes (373)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 5272 5266 -0.1% 1.00x (?)
AnyHashableWithAClass 92134 92336 +0.2% 1.00x
Array2D 635636 642320 +1.1% 0.99x
ArrayAppend 3943 3941 -0.1% 1.00x (?)
ArrayAppendArrayOfInt 689 690 +0.1% 1.00x (?)
ArrayAppendAscii 37866 37480 -1.0% 1.01x
ArrayAppendFromGeneric 687 686 -0.1% 1.00x (?)
ArrayAppendGenericStructs 1371 1370 -0.1% 1.00x (?)
ArrayAppendLatin1 66471 67009 +0.8% 0.99x (?)
ArrayAppendLazyMap 178400 178567 +0.1% 1.00x
ArrayAppendOptionals 1358 1361 +0.2% 1.00x (?)
ArrayAppendRepeatCol 188777 187550 -0.6% 1.01x
ArrayAppendReserved 3687 3687 +0.0% 1.00x
ArrayAppendSequence 154740 153957 -0.5% 1.01x
ArrayAppendStrings 15565 15648 +0.5% 0.99x (?)
ArrayAppendToFromGeneric 685 685 +0.0% 1.00x
ArrayAppendToGeneric 686 693 +1.0% 0.99x (?)
ArrayAppendUTF16 62949 63235 +0.5% 1.00x (?)
ArrayInClass 6365 6360 -0.1% 1.00x
ArrayLiteral 1860 1859 -0.1% 1.00x (?)
ArrayOfGenericPOD2 863 864 +0.1% 1.00x (?)
ArrayOfGenericRef 10401 10408 +0.1% 1.00x (?)
ArrayOfRef 9557 9551 -0.1% 1.00x (?)
ArrayPlusEqualArrayOfInt 686 685 -0.1% 1.00x (?)
ArrayPlusEqualFiveElementCollection 243644 239778 -1.6% 1.02x
ArrayPlusEqualSingleElementCollection 240612 236938 -1.5% 1.02x
ArrayPlusEqualThreeElements 9481 9377 -1.1% 1.01x
ArraySubscript 110872 111029 +0.1% 1.00x (?)
ArrayValueProp 3777 3791 +0.4% 1.00x (?)
ArrayValueProp2 16856 16914 +0.3% 1.00x (?)
ArrayValueProp3 4240 4244 +0.1% 1.00x (?)
ArrayValueProp4 4215 4221 +0.1% 1.00x (?)
BinaryFloatingPointConversionFromBinaryInteger 5034 5071 +0.7% 0.99x (?)
BinaryFloatingPointPropertiesBinade 75 75 +0.0% 1.00x
BinaryFloatingPointPropertiesNextUp 121 117 -3.3% 1.03x
BinaryFloatingPointPropertiesUlp 119 116 -2.5% 1.03x
BitCount 6760 6769 +0.1% 1.00x
ByteSwap 9295 9277 -0.2% 1.00x
COWTree 11039 11100 +0.6% 0.99x (?)
CSVParsing 2381508 2372441 -0.4% 1.00x (?)
CSVParsingAlt 1279588 1285106 +0.4% 1.00x (?)
CSVParsingAltIndices 2238401 2199910 -1.7% 1.02x
CStringLongAscii 3800 3837 +1.0% 0.99x (?)
CStringLongNonAscii 1966 1956 -0.5% 1.01x
CStringShortAscii 7672 7688 +0.2% 1.00x (?)
Calculator 1351 1357 +0.4% 1.00x (?)
CaptureProp 278286 271192 -2.5% 1.03x
CharIndexing_ascii_unicodeScalars 363054 362230 -0.2% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 412427 412121 -0.1% 1.00x (?)
CharIndexing_chinese_unicodeScalars 277582 275418 -0.8% 1.01x (?)
CharIndexing_chinese_unicodeScalars_Backwards 301128 316112 +5.0% 0.95x (?)
CharIndexing_japanese_unicodeScalars 448489 450574 +0.5% 1.00x (?)
CharIndexing_japanese_unicodeScalars_Backwards 486532 483536 -0.6% 1.01x (?)
CharIndexing_korean_unicodeScalars 353338 351376 -0.6% 1.01x (?)
CharIndexing_korean_unicodeScalars_Backwards 390010 400825 +2.8% 0.97x (?)
CharIndexing_punctuatedJapanese_unicodeScalars 64329 64308 -0.0% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 71147 71587 +0.6% 0.99x (?)
CharIndexing_punctuated_unicodeScalars 81713 81936 +0.3% 1.00x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 88280 88325 +0.1% 1.00x (?)
CharIndexing_russian_unicodeScalars 307572 304151 -1.1% 1.01x (?)
CharIndexing_russian_unicodeScalars_Backwards 335360 344769 +2.8% 0.97x
CharIndexing_tweet_unicodeScalars 724023 731412 +1.0% 0.99x (?)
CharIndexing_tweet_unicodeScalars_Backwards 797296 834471 +4.7% 0.96x
CharIndexing_utf16_unicodeScalars 315878 310723 -1.6% 1.02x
CharIndexing_utf16_unicodeScalars_Backwards 337501 344918 +2.2% 0.98x
CharIteration_ascii_unicodeScalars 156688 155399 -0.8% 1.01x
CharIteration_ascii_unicodeScalars_Backwards 300504 301988 +0.5% 1.00x (?)
CharIteration_chinese_unicodeScalars 118739 117333 -1.2% 1.01x
CharIteration_chinese_unicodeScalars_Backwards 227032 230380 +1.5% 0.99x (?)
CharIteration_japanese_unicodeScalars 187338 185966 -0.7% 1.01x
CharIteration_japanese_unicodeScalars_Backwards 363711 361800 -0.5% 1.01x (?)
CharIteration_korean_unicodeScalars 151673 150483 -0.8% 1.01x
CharIteration_korean_unicodeScalars_Backwards 295766 295178 -0.2% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars 28185 28065 -0.4% 1.00x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 53342 52972 -0.7% 1.01x (?)
CharIteration_punctuated_unicodeScalars 35255 35003 -0.7% 1.01x
CharIteration_punctuated_unicodeScalars_Backwards 67304 66786 -0.8% 1.01x (?)
CharIteration_russian_unicodeScalars 130392 129147 -1.0% 1.01x (?)
CharIteration_russian_unicodeScalars_Backwards 252893 251595 -0.5% 1.01x (?)
CharIteration_tweet_unicodeScalars 309176 306072 -1.0% 1.01x
CharIteration_tweet_unicodeScalars_Backwards 598074 598601 +0.1% 1.00x (?)
CharIteration_utf16_unicodeScalars 132500 131770 -0.6% 1.01x
CharIteration_utf16_unicodeScalars_Backwards 256500 256513 +0.0% 1.00x (?)
CharacterLiteralsLarge 6041 6059 +0.3% 1.00x (?)
CharacterLiteralsSmall 630 612 -2.9% 1.03x
CharacterPropertiesFetch 5390 5448 +1.1% 0.99x
CharacterPropertiesPrecomputed 4346 4315 -0.7% 1.01x (?)
CharacterPropertiesStashed 2335 2337 +0.1% 1.00x (?)
CharacterPropertiesStashedMemo 4970 4945 -0.5% 1.01x (?)
Chars 42100 41325 -1.8% 1.02x
ClassArrayGetter 1025 1020 -0.5% 1.00x (?)
Combos 1863 1866 +0.2% 1.00x (?)
DictOfArraysToArrayOfDicts 3071 3064 -0.2% 1.00x (?)
Dictionary 2728 2794 +2.4% 0.98x
Dictionary2 3099 3036 -2.0% 1.02x (?)
Dictionary2OfObjects 5640 5669 +0.5% 0.99x (?)
Dictionary3 1424 1406 -1.3% 1.01x
Dictionary3OfObjects 2372 2359 -0.5% 1.01x
Dictionary4 1218 1211 -0.6% 1.01x
Dictionary4OfObjects 1837 1839 +0.1% 1.00x (?)
DictionaryBridge 1706 1730 +1.4% 0.99x
DictionaryGroup 4342 4324 -0.4% 1.00x
DictionaryGroupOfObjects 7528 7570 +0.6% 0.99x
DictionaryLiteral 8991 8988 -0.0% 1.00x (?)
DictionaryOfObjects 6118 6254 +2.2% 0.98x (?)
DictionaryRemove 19657 19641 -0.1% 1.00x (?)
DictionaryRemoveOfObjects 52419 53140 +1.4% 0.99x (?)
DictionarySubscriptDefaultMutation 2134 2121 -0.6% 1.01x
DictionarySubscriptDefaultMutationArray 2408 2389 -0.8% 1.01x
DictionarySubscriptDefaultMutationArrayOfObjects 9327 9371 +0.5% 1.00x
DictionarySubscriptDefaultMutationOfObjects 5799 5773 -0.4% 1.00x (?)
DictionarySwap 6148 6227 +1.3% 0.99x
DictionarySwapOfObjects 23467 23581 +0.5% 1.00x (?)
DoubleWidthDivision 0 0 +0.0% 1.00x
DropFirstAnyCollection 14174 14195 +0.1% 1.00x (?)
DropFirstAnyCollectionLazy 101761 101130 -0.6% 1.01x (?)
DropFirstAnySeqCRangeIter 22156 22137 -0.1% 1.00x
DropFirstAnySeqCRangeIterLazy 22140 22108 -0.1% 1.00x
DropFirstAnySeqCntRange 14342 14393 +0.4% 1.00x (?)
DropFirstAnySeqCntRangeLazy 14145 14221 +0.5% 0.99x (?)
DropFirstAnySequence 11689 12125 +3.7% 0.96x
DropFirstAnySequenceLazy 11758 11888 +1.1% 0.99x
DropFirstArray 3999 3997 -0.1% 1.00x (?)
DropFirstArrayLazy 26562 26538 -0.1% 1.00x (?)
DropFirstCountableRange 328 327 -0.3% 1.00x
DropFirstCountableRangeLazy 27110 27092 -0.1% 1.00x (?)
DropFirstSequence 11154 11178 +0.2% 1.00x
DropFirstSequenceLazy 11096 11273 +1.6% 0.98x
DropLastAnyCollection 4748 4741 -0.1% 1.00x (?)
DropLastAnyCollectionLazy 33748 33628 -0.4% 1.00x (?)
DropLastAnySeqCRangeIter 39275 39362 +0.2% 1.00x (?)
DropLastAnySeqCRangeIterLazy 39432 39537 +0.3% 1.00x (?)
DropLastAnySeqCntRange 4719 4745 +0.6% 0.99x
DropLastAnySeqCntRangeLazy 4783 4801 +0.4% 1.00x
DropLastAnySequence 30409 30435 +0.1% 1.00x (?)
DropLastAnySequenceLazy 30047 30338 +1.0% 0.99x (?)
DropLastCountableRange 115 115 +0.0% 1.00x
DropLastCountableRangeLazy 9023 9044 +0.2% 1.00x
DropLastSequence 29888 29855 -0.1% 1.00x (?)
DropLastSequenceLazy 29968 29976 +0.0% 1.00x (?)
DropWhileAnyCollection 18049 18249 +1.1% 0.99x
DropWhileAnyCollectionLazy 20787 20870 +0.4% 1.00x
DropWhileAnySeqCRangeIter 23657 23790 +0.6% 0.99x (?)
DropWhileAnySeqCRangeIterLazy 20731 21075 +1.7% 0.98x (?)
DropWhileAnySeqCntRange 17893 17988 +0.5% 0.99x (?)
DropWhileAnySeqCntRangeLazy 20860 20897 +0.2% 1.00x
DropWhileAnySequence 13632 13814 +1.3% 0.99x
DropWhileAnySequenceLazy 11662 11400 -2.2% 1.02x
DropWhileArrayLazy 14717 14725 +0.1% 1.00x (?)
DropWhileCountableRange 4086 4130 +1.1% 0.99x
DropWhileCountableRangeLazy 20264 20412 +0.7% 0.99x (?)
DropWhileSequence 12884 12802 -0.6% 1.01x
DropWhileSequenceLazy 11202 11216 +0.1% 1.00x (?)
EqualStringSubstring 90 89 -1.1% 1.01x
EqualSubstringString 91 90 -1.1% 1.01x
EqualSubstringSubstring 89 88 -1.1% 1.01x
EqualSubstringSubstringGenericEquatable 94 94 +0.0% 1.00x
ErrorHandling 6894 6857 -0.5% 1.01x (?)
ExclusivityGlobal 176 169 -4.0% 1.04x
ExclusivityIndependent 69 66 -4.3% 1.05x
FilterEvenUsingReduce 3763 3759 -0.1% 1.00x (?)
FilterEvenUsingReduceInto 1964 1954 -0.5% 1.01x
FrequenciesUsingReduce 10321 10267 -0.5% 1.01x (?)
FrequenciesUsingReduceInto 5382 5431 +0.9% 0.99x (?)
Hanoi 20473 20707 +1.1% 0.99x (?)
HashTest 20709 20709 +0.0% 1.00x
Histogram 6910 6913 +0.0% 1.00x (?)
Integrate 810 792 -2.2% 1.02x
IterateData 6647 6850 +3.1% 0.97x
Join 1136 1131 -0.4% 1.00x (?)
LazilyFilteredArrayContains 812624 824444 +1.5% 0.99x
LazilyFilteredArrays 1457455 1450766 -0.5% 1.00x (?)
LazilyFilteredRange 508334 503766 -0.9% 1.01x
LessSubstringSubstring 89 89 +0.0% 1.00x
LessSubstringSubstringGenericComparable 93 91 -2.2% 1.02x
LinkedList 33186 33214 +0.1% 1.00x (?)
LuhnAlgoEager 3819 3813 -0.2% 1.00x (?)
LuhnAlgoLazy 3812 3907 +2.5% 0.98x (?)
MapReduce 26325 26649 +1.2% 0.99x
MapReduceAnyCollection 26280 26638 +1.4% 0.99x
MapReduceAnyCollectionShort 37459 37611 +0.4% 1.00x (?)
MapReduceClass 31393 31437 +0.1% 1.00x (?)
MapReduceClassShort 41401 41651 +0.6% 0.99x (?)
MapReduceLazyCollection 24163 24327 +0.7% 0.99x
MapReduceLazyCollectionShort 35207 35136 -0.2% 1.00x (?)
MapReduceLazySequence 19465 19808 +1.8% 0.98x
MapReduceSequence 30870 30942 +0.2% 1.00x
MapReduceShort 37567 37865 +0.8% 0.99x
MapReduceShortString 225 225 +0.0% 1.00x
MapReduceString 1849 1850 +0.1% 1.00x (?)
MonteCarloE 1188138 1196689 +0.7% 0.99x
MonteCarloPi 5355628 5386248 +0.6% 0.99x
NSDictionaryCastToSwift 6788 6640 -2.2% 1.02x (?)
NSError 732 731 -0.1% 1.00x (?)
NSStringConversion 284 287 +1.1% 0.99x (?)
NibbleSort 435413 433090 -0.5% 1.01x (?)
NopDeinit 158683 156575 -1.3% 1.01x (?)
ObjectAllocation 1388 1382 -0.4% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObject 20879 20485 -1.9% 1.02x
ObjectiveCBridgeFromNSArrayAnyObjectForced 7023 7037 +0.2% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 37613 37771 +0.4% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 33095 32930 -0.5% 1.01x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 107176 106745 -0.4% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObject 57183 56863 -0.6% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 6122 6215 +1.5% 0.99x
ObjectiveCBridgeFromNSSetAnyObjectToString 68375 68219 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSString 3095 3125 +1.0% 0.99x (?)
ObjectiveCBridgeFromNSStringForced 2492 2513 +0.8% 0.99x
ObjectiveCBridgeStubDataAppend 4546 4503 -0.9% 1.01x (?)
ObjectiveCBridgeStubDateMutation 546 546 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 23903 24419 +2.2% 0.98x
ObjectiveCBridgeStubFromNSDate 4455 4467 +0.3% 1.00x
ObjectiveCBridgeStubFromNSString 796 774 -2.8% 1.03x
ObjectiveCBridgeStubFromNSStringRef 175 178 +1.7% 0.98x (?)
ObjectiveCBridgeStubNSDataAppend 2809 2796 -0.5% 1.00x (?)
ObjectiveCBridgeStubNSDateMutationRef 19351 19880 +2.7% 0.97x (?)
ObjectiveCBridgeStubToArrayOfNSString 28881 28820 -0.2% 1.00x (?)
ObjectiveCBridgeStubToNSDateRef 3658 3636 -0.6% 1.01x (?)
ObjectiveCBridgeStubToNSString 1626 1635 +0.6% 0.99x (?)
ObjectiveCBridgeStubToNSStringRef 138 138 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 249518 248386 -0.5% 1.00x (?)
ObjectiveCBridgeStubURLAppendPathRef 252290 247432 -1.9% 1.02x (?)
ObjectiveCBridgeToNSArray 29177 29211 +0.1% 1.00x (?)
ObjectiveCBridgeToNSDictionary 42880 43094 +0.5% 1.00x (?)
ObjectiveCBridgeToNSSet 36353 36433 +0.2% 1.00x (?)
ObjectiveCBridgeToNSString 1392 1397 +0.4% 1.00x
ObserverClosure 6481 6475 -0.1% 1.00x (?)
ObserverForwarderStruct 4563 4636 +1.6% 0.98x
ObserverPartiallyAppliedMethod 8059 8014 -0.6% 1.01x (?)
ObserverUnappliedMethod 8140 8186 +0.6% 0.99x (?)
PartialApplyDynamicType 43281 42798 -1.1% 1.01x (?)
Phonebook 18985 19062 +0.4% 1.00x
PolymorphicCalls 4726 4709 -0.4% 1.00x (?)
PopFrontArray 4277 4210 -1.6% 1.02x
PopFrontArrayGeneric 5249 5252 +0.1% 1.00x (?)
PopFrontUnsafePointer 7478 7437 -0.5% 1.01x
PrefixAnyCollection 14153 14210 +0.4% 1.00x (?)
PrefixAnyCollectionLazy 101637 101687 +0.0% 1.00x (?)
PrefixAnySeqCRangeIter 17934 17881 -0.3% 1.00x
PrefixAnySeqCRangeIterLazy 17922 17866 -0.3% 1.00x
PrefixAnySeqCntRange 14332 14366 +0.2% 1.00x
PrefixAnySeqCntRangeLazy 14153 14194 +0.3% 1.00x
PrefixAnySequence 9792 9773 -0.2% 1.00x (?)
PrefixAnySequenceLazy 9903 10058 +1.6% 0.98x
PrefixArray 3994 4011 +0.4% 1.00x (?)
PrefixArrayLazy 26693 26610 -0.3% 1.00x (?)
PrefixCountableRange 328 329 +0.3% 1.00x (?)
PrefixCountableRangeLazy 27063 27084 +0.1% 1.00x
PrefixSequence 9212 9104 -1.2% 1.01x
PrefixSequenceLazy 9147 9398 +2.7% 0.97x
PrefixWhileAnyCollection 25599 25764 +0.6% 0.99x
PrefixWhileAnyCollectionLazy 17321 17339 +0.1% 1.00x (?)
PrefixWhileAnySeqCRangeIter 34272 34357 +0.2% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 17205 17217 +0.1% 1.00x (?)
PrefixWhileAnySeqCntRange 25427 25503 +0.3% 1.00x
PrefixWhileAnySeqCntRangeLazy 17258 17293 +0.2% 1.00x (?)
PrefixWhileAnySequence 27272 27145 -0.5% 1.00x (?)
PrefixWhileAnySequenceLazy 10251 10117 -1.3% 1.01x (?)
PrefixWhileArray 11163 11122 -0.4% 1.00x
PrefixWhileArrayLazy 13146 13121 -0.2% 1.00x
PrefixWhileCountableRange 11541 11589 +0.4% 1.00x
PrefixWhileCountableRangeLazy 17368 17416 +0.3% 1.00x (?)
PrefixWhileSequence 26867 26630 -0.9% 1.01x (?)
PrefixWhileSequenceLazy 10333 10336 +0.0% 1.00x (?)
Prims 9660 9722 +0.6% 0.99x (?)
PrimsSplit 9679 9743 +0.7% 0.99x (?)
QueueConcrete 14998 14967 -0.2% 1.00x
QueueGeneric 19469 19473 +0.0% 1.00x (?)
RC4 16764 16797 +0.2% 1.00x
RGBHistogram 26981 26787 -0.7% 1.01x
RGBHistogramOfObjects 98012 97710 -0.3% 1.00x
RangeAssignment 2231 2206 -1.1% 1.01x
RangeIterationSigned 17119 16786 -1.9% 1.02x (?)
RangeIterationSigned64 40774 40871 +0.2% 1.00x (?)
RangeIterationUnsigned 36372 36133 -0.7% 1.01x (?)
RangeReplaceableCollectionPlusDefault 7671 7695 +0.3% 1.00x (?)
RecursiveOwnedParameter 8164 8080 -1.0% 1.01x
RemoveWhereFilterInts 2135 2168 +1.5% 0.98x
RemoveWhereFilterString 1498 1517 +1.3% 0.99x
RemoveWhereFilterStrings 3068 3095 +0.9% 0.99x
RemoveWhereMoveInts 3395 3412 +0.5% 1.00x
RemoveWhereMoveStrings 4144 4160 +0.4% 1.00x
RemoveWhereQuadraticInts 7822 7886 +0.8% 0.99x
RemoveWhereQuadraticString 2340 2352 +0.5% 0.99x
RemoveWhereQuadraticStrings 9701 9740 +0.4% 1.00x
RemoveWhereSwapInts 6054 6092 +0.6% 0.99x (?)
RemoveWhereSwapStrings 6767 6823 +0.8% 0.99x
ReversedArray 13581 13758 +1.3% 0.99x
ReversedBidirectional 44241 44329 +0.2% 1.00x (?)
ReversedDictionary 24233 24186 -0.2% 1.00x (?)
RomanNumbers 1107871 1116703 +0.8% 0.99x (?)
SequenceAlgosAnySequence 11811 11828 +0.1% 1.00x
SequenceAlgosArray 832429 830726 -0.2% 1.00x (?)
SequenceAlgosContiguousArray 359055 355898 -0.9% 1.01x
SequenceAlgosList 8727 8710 -0.2% 1.00x (?)
SequenceAlgosRange 1148914 1154860 +0.5% 0.99x
SequenceAlgosUnfoldSequence 6208 6046 -2.6% 1.03x
SetExclusiveOr 18523 18471 -0.3% 1.00x (?)
SetExclusiveOr_OfObjects 43458 43318 -0.3% 1.00x (?)
SetIntersect 9258 9437 +1.9% 0.98x
SetIntersect_OfObjects 13439 13549 +0.8% 0.99x
SetIsSubsetOf 1510 1519 +0.6% 0.99x (?)
SetIsSubsetOf_OfObjects 1728 1742 +0.8% 0.99x
SetUnion 12308 12349 +0.3% 1.00x
SetUnion_OfObjects 30237 30141 -0.3% 1.00x (?)
SevenBoom 1696 1684 -0.7% 1.01x
Sim2DArray 44171 44176 +0.0% 1.00x (?)
SortLargeExistentials 15799 15757 -0.3% 1.00x (?)
SortLettersInPlace 2701 2708 +0.3% 1.00x (?)
SortSortedStrings 947 966 +2.0% 0.98x
SortStrings 1961 1975 +0.7% 0.99x
SortStringsUnicode 2566 2684 +4.6% 0.96x
StackPromo 93442 92557 -0.9% 1.01x
StaticArray 2139 2135 -0.2% 1.00x (?)
StrComplexWalk 5687 5675 -0.2% 1.00x (?)
StrToInt 57797 57719 -0.1% 1.00x (?)
StringAdder 4843 4813 -0.6% 1.01x
StringBuilder 6912 6848 -0.9% 1.01x (?)
StringBuilderLong 2427 2336 -3.7% 1.04x (?)
StringComparison_abnormal 1347 1354 +0.5% 0.99x (?)
StringComparison_ascii 9842 9806 -0.4% 1.00x
StringComparison_emoji 2130 2130 +0.0% 1.00x
StringComparison_fastPrenormal 5681 5641 -0.7% 1.01x
StringComparison_longSharedPrefix 2315 2308 -0.3% 1.00x (?)
StringComparison_nonBMPSlowestPrenormal 3900 3906 +0.2% 1.00x (?)
StringComparison_slowerPrenormal 4423 4422 -0.0% 1.00x (?)
StringComparison_zalgo 95379 95867 +0.5% 0.99x (?)
StringEdits 293649 291476 -0.7% 1.01x (?)
StringEnumRawValueInitialization 16997 16918 -0.5% 1.00x (?)
StringEqualPointerComparison 3061 3152 +3.0% 0.97x
StringFromLongWholeSubstring 22 22 +0.0% 1.00x
StringFromLongWholeSubstringGeneric 209 207 -1.0% 1.01x
StringHasPrefixUnicode 27466 27302 -0.6% 1.01x (?)
StringHasSuffixAscii 2681 2808 +4.7% 0.95x
StringHasSuffixUnicode 74916 75320 +0.5% 0.99x
StringInterpolation 12923 12880 -0.3% 1.00x (?)
StringMatch 31340 31093 -0.8% 1.01x (?)
StringRemoveDupes 1450 1444 -0.4% 1.00x
StringUTF16Builder 7788 7782 -0.1% 1.00x (?)
StringWalk 12121 12301 +1.5% 0.99x
StringWithCString 29562 29647 +0.3% 1.00x (?)
StringWordBuilder 2464 2463 -0.0% 1.00x (?)
StringWordBuilderReservingCapacity 2140 2141 +0.0% 1.00x (?)
SubstringComparable 2111 2118 +0.3% 1.00x (?)
SubstringEqualString 1939 1956 +0.9% 0.99x (?)
SubstringEquatable 6134 6106 -0.5% 1.00x
SubstringFromLongString 25 25 +0.0% 1.00x
SubstringFromLongStringGeneric 107 109 +1.9% 0.98x
SuffixAnyCollection 4729 4753 +0.5% 0.99x
SuffixAnyCollectionLazy 34112 33943 -0.5% 1.00x (?)
SuffixAnySeqCRangeIter 35131 35432 +0.9% 0.99x (?)
SuffixAnySeqCRangeIterLazy 35234 35153 -0.2% 1.00x (?)
SuffixAnySeqCntRange 4728 4738 +0.2% 1.00x
SuffixAnySeqCntRangeLazy 4776 4797 +0.4% 1.00x
SuffixAnySequence 26020 25957 -0.2% 1.00x (?)
SuffixAnySequenceLazy 25816 25806 -0.0% 1.00x (?)
SuffixCountableRange 114 114 +0.0% 1.00x
SuffixCountableRangeLazy 9029 9042 +0.1% 1.00x (?)
SuffixSequence 25601 25667 +0.3% 1.00x
SuffixSequenceLazy 25919 25776 -0.6% 1.01x (?)
SumUsingReduce 172360 171243 -0.6% 1.01x
SumUsingReduceInto 164697 165213 +0.3% 1.00x
SuperChars 127994 127907 -0.1% 1.00x (?)
TwoSum 4429 4450 +0.5% 1.00x (?)
UTF8Decode 31208 31141 -0.2% 1.00x
Walsh 11873 11869 -0.0% 1.00x (?)
WordCountHistogramASCII 46861 46913 +0.1% 1.00x (?)
WordCountHistogramUTF16 60871 61730 +1.4% 0.99x (?)
WordCountUniqueASCII 8163 8235 +0.9% 0.99x
WordCountUniqueUTF16 22061 22291 +1.0% 0.99x (?)
WordSplitASCII 23736 23505 -1.0% 1.01x (?)
WordSplitUTF16 24122 24416 +1.2% 0.99x (?)
XorLoop 23578 23575 -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

@xwu xwu changed the title [WIP] [stdlib] Add faster 32-bit and 64-bit binade, nextUp, ulp [stdlib] Add faster 32-bit and 64-bit binade, nextUp, ulp Mar 6, 2018
// On arm, flush positive subnormal values to 0.
return 0
#else
return .leastNonzeroMagnitude
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Based on your points below, I'm going to delete the compilation condition and return .leastNormalMagnitude * 0x1p-${SignificandBitCount} here.

@xwu
Copy link
Collaborator Author

xwu commented Mar 7, 2018

@swift-ci Please smoke test

@stephentyrone
Copy link
Contributor

There's a few comments that I'd like to tweak, but they're very minor and you've already kicked off testing, so I'll just do them in a separate commit after this lands. LGTM.

@xwu xwu merged commit 94c18c6 into swiftlang:master Mar 7, 2018
@xwu xwu deleted the better-nextups-and-ulps branch March 7, 2018 02:09
@eeckstein
Copy link
Contributor

@xwu: I reverted this PR, because it broke a test in optimize mode. See #15048

This does not necessarily mean that there is a problem in your code. It could also be a compiler problem. But it needs to be resolved before this change can land.

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