Skip to content

[stdlib] Speed up Character.init significantly for small characters. #6850

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
Jan 26, 2017

Conversation

allevato
Copy link
Member

Directly computes the 63-bit representation for Character literals whose UTF-8 encoding will fit in the .small representation, instead of unconditionally constructing a String and paying the cost of that heap allocation. This speed-up is helpful when using character literals in parsing loops; if you have a switch statement over characters in a string and the cases are literals, you're currently constructing many temporary strings to perform those comparisons.

In optimized builds, the compiler evaluates the whole computation and turns small characters into a single load operation. For example, these functions:

func makeUTF8_1() -> Character {
  return "a" as Character
}
func makeUTF8_8() -> Character {
  return "\u{00a9}\u{0300}\u{0301}\u{0302}" as Character
}

are compiled to the following x86_64 code, replacing string allocations with:

; make_UTF8_1
push       rbp
mov        rbp, rsp
movabs     rax, 0x7fffffffffffff61
mov        dl, 0x1
pop        rbp
ret

; make_UTF8_8
push       rbp
mov        rbp, rsp
movabs     rax, 0x2cc81cc80cca9c2
mov        dl, 0x1
pop        rbp
ret

Large character literals also benefit from this change; we already know that it won't fit based on the UTF-8 count, so we can bypass the unnecessary UTF-8 encode that would happen if we passed it to Character.init(String).

Performance was tested on my late 2013 MacBook Pro 2.4GHz Intel Core i5 by creating characters of various sizes 1,000,000 times. Results:

UTF-8 count    Before       After
1              473.62 ms      2.9964 ms
8              862.82 ms      2.7181 ms
9              967.94 ms    437.10   ms

So, anywhere from ~150–300x improvements for small characters and 2x for some large ones.

This optimization checks to see if a Character can fit in the 63-bit
small representation instead of unconditionally constructing a String
and paying the cost of that allocation. If it does, the small
representation is computed directly from its UTF-8 code units.

In optimized builds, this turns Character literals <= 8 UTF-8 code units
long into single 64-bit integer loads -- a huge improvement.
@allevato
Copy link
Member Author

@swift-ci Please test

dest: UnsafeMutableRawPointer(Builtin.addressof(&buffer)),
src: UnsafeMutableRawPointer(start),
size: UInt(utf8CodeUnitCount))
let utf8Chunk = UInt64(littleEndian: buffer)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: is this kosher for big-endian systems?

Copy link
Member Author

@allevato allevato Jan 17, 2017

Choose a reason for hiding this comment

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

The .small representation orders the packed code units from low to high bits. Since we're doing a memcpy of code units directly into the memory occupied by a UInt64, it's assuming little-endianness everywhere, and the UInt64.init(littleEndian:) call is necessary to ensure the correct integer representation on big-endian systems. The same logic—which I adapted—already exists in the function called by Character.init(String:) here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. Maybe some of the comments from the other place would be illuminating here too.

src: UnsafeMutableRawPointer(start),
size: UInt(utf8CodeUnitCount))
let utf8Chunk = UInt64(littleEndian: buffer)
let bits = MemoryLayout.size(ofValue: utf8Chunk) &* 8 &- 1
Copy link
Collaborator

@xwu xwu Jan 17, 2017

Choose a reason for hiding this comment

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

This is just MemoryLayout<UInt64>.size. But why can't you hardcode 63 instead of using bits? (Edit: In fact, since you're explicitly invoking built-ins that expect 64 bits, this probably should just be 63 below.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I deliberately kept my logic similar to what was already implemented elsewhere in the Character type. Since I'm not the original author, I can only guess the reason it was written that way—I could imagine resilience being a motivation if the type used for .small were to ever change. In that case, I could consider replacing the hardcoded 8 in the main conditional to something MemoryLayout-based as well.

@slavapestov
Copy link
Contributor

It would be great to add a new benchmark for this!

@xwu
Copy link
Collaborator

xwu commented Jan 17, 2017

One more Q: Now that you bypass the preconditions in init(_: String), how is it ensured that you're storing only the first character in .small? If there is more than one character stored, I think String.init(_: Character) will spit the subsequent ones back out...

@allevato
Copy link
Member Author

@slavapestov I'll look into adding one!

@xwu AFAICT, the compiler won't generate a call to this initializer for a literal that contains more than one grapheme cluster because it would be caught as an error before then. If you try to write "ab" as Character today, you get the error cannot convert value of type 'String' to type 'Character' in coercion, which I believe is enforced based on the fact that Character conforms to ExpressibleByExtendedGraphemeClusterLiteral rather than ExpressibleByStringLiteral. init(_: String) needs the check because the string received at runtime could contain any number of characters.

@xwu
Copy link
Collaborator

xwu commented Jan 17, 2017

@allevato So a 150x improvement for no trade-offs: nice!

@airspeedswift airspeedswift changed the title Speed up Character.init significantly for small characters. [stdlib] Speed up Character.init significantly for small characters. Jan 17, 2017
@airspeedswift
Copy link
Member

@swift-ci Please benchmark

@airspeedswift
Copy link
Member

Definitely would be good to get some specific benchmarks on this change (if you do them in a separate PR, then merge it ahead of this one and rebase, we can see the results from CI on this PR) but just running a preliminary benchmark to see if anything shows up.

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasPrefix 609 749 +23.0% 0.81x
MonteCarloE 10557 12425 +17.7% 0.85x
ObjectiveCBridgeStubDateAccess 182 212 +16.5% 0.86x
ObjectiveCBridgeStubFromNSDate 3829 4127 +7.8% 0.93x
Improvement (7)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
Phonebook 7421 7009 -5.5% 1.06x
Hanoi 3457 3209 -7.2% 1.08x
Calculator 34 31 -8.8% 1.10x
ObjectiveCBridgeStubNSDateRefAccess 338 308 -8.9% 1.10x
CaptureProp 4565 4064 -11.0% 1.12x
OpenClose 54 48 -11.1% 1.12x
StringWithCString 198901 155155 -22.0% 1.28x
No Changes (146)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
PopFrontArray 1170 1129 -3.5% 1.04x(?)
RangeAssignment 290 280 -3.5% 1.04x(?)
SortSortedStrings 830 803 -3.2% 1.03x
NSStringConversion 815 790 -3.1% 1.03x(?)
StringHasSuffix 820 800 -2.4% 1.02x
StaticArray 126 124 -1.6% 1.02x(?)
ObjectiveCBridgeStubURLAppendPathRef 234268 229926 -1.9% 1.02x(?)
ObjectiveCBridgeToNSDictionary 60684 59355 -2.2% 1.02x(?)
SortStrings 1644 1626 -1.1% 1.01x
ObjectiveCBridgeFromNSArrayAnyObjectForced 6215 6183 -0.5% 1.01x(?)
Prims 734 730 -0.5% 1.01x(?)
ObjectiveCBridgeStubToNSDate 13200 13068 -1.0% 1.01x(?)
StringInterpolation 11150 11050 -0.9% 1.01x(?)
AnyHashableWithAClass 65622 65151 -0.7% 1.01x(?)
Integrate 240 238 -0.8% 1.01x
StringHasSuffixUnicode 63325 62989 -0.5% 1.01x(?)
ArrayOfRef 3583 3564 -0.5% 1.01x(?)
ObjectiveCBridgeToNSArray 30472 30177 -1.0% 1.01x(?)
PopFrontUnsafePointer 9141 9059 -0.9% 1.01x(?)
SortStringsUnicode 7269 7203 -0.9% 1.01x(?)
Dictionary 719 715 -0.6% 1.01x(?)
DictionaryRemove 2317 2296 -0.9% 1.01x(?)
156 3042781 3005509 -1.2% 1.01x
ObjectiveCBridgeStubNSDataAppend 2432 2413 -0.8% 1.01x(?)
StringWalk 5898 5867 -0.5% 1.01x(?)
TwoSum 1328 1321 -0.5% 1.01x(?)
ArraySubscript 1432 1433 +0.1% 1.00x(?)
DictionarySwapOfObjects 6232 6260 +0.5% 1.00x(?)
StackPromo 21364 21421 +0.3% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 164934 164836 -0.1% 1.00x(?)
RecursiveOwnedParameter 1935 1933 -0.1% 1.00x(?)
ObjectiveCBridgeStubToNSString 1279 1280 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 96330 96088 -0.2% 1.00x(?)
ClassArrayGetter 12 12 +0.0% 1.00x
Array2D 2031 2035 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5398 5421 +0.4% 1.00x(?)
MonteCarloPi 45246 45065 -0.4% 1.00x
ObjectiveCBridgeFromNSStringForced 2693 2698 +0.2% 1.00x(?)
SortLettersInPlace 1039 1040 +0.1% 1.00x(?)
DictionarySwap 413 413 +0.0% 1.00x
ReversedDictionary 92 92 +0.0% 1.00x
ArrayAppendToFromGeneric 599 599 +0.0% 1.00x
Dictionary3OfObjects 870 871 +0.1% 1.00x(?)
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1236 1240 +0.3% 1.00x(?)
SuperChars 211991 211595 -0.2% 1.00x(?)
ArrayAppendLazyMap 915 915 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 52042 52133 +0.2% 1.00x(?)
XorLoop 380 380 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 48285 48243 -0.1% 1.00x(?)
ArrayAppendStrings 12123 12132 +0.1% 1.00x(?)
ProtocolDispatch 3040 3040 +0.0% 1.00x
ObjectAllocation 153 153 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 80542 80887 +0.4% 1.00x(?)
AngryPhonebook 2852 2840 -0.4% 1.00x(?)
ArrayPlusEqualArrayOfInt 599 599 +0.0% 1.00x
Dictionary3 520 521 +0.2% 1.00x(?)
Dictionary2 2030 2029 -0.1% 1.00x(?)
StrComplexWalk 2907 2899 -0.3% 1.00x(?)
SetIntersect_OfObjects 1491 1493 +0.1% 1.00x(?)
Join 465 463 -0.4% 1.00x(?)
ObserverUnappliedMethod 2333 2330 -0.1% 1.00x(?)
ObjectiveCBridgeToNSSet 37741 37618 -0.3% 1.00x(?)
ArrayAppendOptionals 1236 1233 -0.2% 1.00x(?)
NSError 323 324 +0.3% 1.00x(?)
StringEqualPointerComparison 7304 7297 -0.1% 1.00x(?)
PolymorphicCalls 22 22 +0.0% 1.00x
ArrayAppendReserved 536 536 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 116 116 +0.0% 1.00x
ArrayAppendFromGeneric 599 599 +0.0% 1.00x
MapReduce 342 342 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 273 273 +0.0% 1.00x
DictionaryLiteral 1273 1267 -0.5% 1.00x
ArrayOfGenericPOD 220 220 +0.0% 1.00x
DictionaryRemoveOfObjects 19358 19359 +0.0% 1.00x(?)
ObjectiveCBridgeStubURLAppendPath 231741 232747 +0.4% 1.00x(?)
SetIsSubsetOf 250 250 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 74513 74638 +0.2% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3410 3413 +0.1% 1.00x(?)
SetExclusiveOr 2555 2551 -0.2% 1.00x(?)
NSDictionaryCastToSwift 4989 4975 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 115570 115855 +0.2% 1.00x(?)
StrToInt 5081 5100 +0.4% 1.00x(?)
ArrayOfGenericRef 3680 3663 -0.5% 1.00x(?)
ObjectiveCBridgeFromNSString 1788 1792 +0.2% 1.00x(?)
Sim2DArray 277 277 +0.0% 1.00x
ArrayAppendRepeatCol 759 758 -0.1% 1.00x(?)
ReversedBidirectional 44910 44948 +0.1% 1.00x(?)
RC4 165 165 +0.0% 1.00x
ArrayAppendToGeneric 599 599 +0.0% 1.00x
HashTest 1752 1748 -0.2% 1.00x(?)
SetIsSubsetOf_OfObjects 306 307 +0.3% 1.00x(?)
ArrayAppend 774 775 +0.1% 1.00x(?)
StringHasPrefixUnicode 14265 14213 -0.4% 1.00x(?)
LinkedList 7252 7248 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 81138 81426 +0.3% 1.00x(?)
RGBHistogramOfObjects 21408 21368 -0.2% 1.00x(?)
RGBHistogram 2276 2286 +0.4% 1.00x(?)
ArrayAppendSequence 1394 1391 -0.2% 1.00x(?)
ArrayAppendArrayOfInt 599 599 +0.0% 1.00x
ArrayOfPOD 182 182 +0.0% 1.00x
SetUnion 2434 2432 -0.1% 1.00x(?)
ReversedArray 49 49 +0.0% 1.00x
StringBuilder 1314 1311 -0.2% 1.00x(?)
DeadArray 185 185 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
ArrayLiteral 1180 1177 -0.2% 1.00x(?)
SevenBoom 1343 1342 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 88715 88639 -0.1% 1.00x(?)
ArrayValueProp 6 6 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 56922 57117 +0.3% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 235 235 +0.0% 1.00x
Dictionary2OfObjects 3421 3436 +0.4% 1.00x(?)
ArrayValueProp4 6 6 +0.0% 1.00x
ArrayValueProp2 6 6 +0.0% 1.00x
ArrayValueProp3 6 6 +0.0% 1.00x
ObserverPartiallyAppliedMethod 3366 3367 +0.0% 1.00x(?)
ObjectiveCBridgeToNSString 1067 1074 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 171500 172872 +0.8% 0.99x(?)
DictionaryBridge 3333 3354 +0.6% 0.99x(?)
ObserverClosure 1965 1979 +0.7% 0.99x(?)
ErrorHandling 2906 2923 +0.6% 0.99x(?)
ProtocolDispatch2 157 158 +0.6% 0.99x
DictionaryOfObjects 2273 2286 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 107234 108024 +0.7% 0.99x(?)
NopDeinit 21432 21737 +1.4% 0.99x
SetExclusiveOr_OfObjects 7390 7456 +0.9% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4656 4686 +0.6% 0.99x(?)
ObserverForwarderStruct 886 892 +0.7% 0.99x(?)
Histogram 281 286 +1.8% 0.98x(?)
ObjectiveCBridgeStubFromNSDateRef 3960 4030 +1.8% 0.98x
ObjectiveCBridgeStubFromNSString 761 775 +1.8% 0.98x(?)
Walsh 313 320 +2.2% 0.98x
PopFrontArrayGeneric 1122 1149 +2.4% 0.98x(?)
UTF8Decode 288 293 +1.7% 0.98x
ObjectiveCBridgeStubToArrayOfNSString 29037 29670 +2.2% 0.98x(?)
ArrayInClass 62 63 +1.6% 0.98x(?)
SetUnion_OfObjects 6185 6291 +1.7% 0.98x(?)
ObjectiveCBridgeStubNSDateMutationRef 11565 11817 +2.2% 0.98x(?)
ObjectiveCBridgeStubToNSDateRef 3203 3292 +2.8% 0.97x(?)
IterateData 2524 2613 +3.5% 0.97x
SetIntersect 356 367 +3.1% 0.97x(?)
ObjectiveCBridgeStubFromNSStringRef 125 130 +4.0% 0.96x
Chars 615 639 +3.9% 0.96x
**Unoptimized (Onone)**
Regression (5)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
NopDeinit 44684 49017 +9.7% 0.91x
ObjectiveCBridgeStubDateMutation 443 486 +9.7% 0.91x
StringWalk 20561 22692 +10.4% 0.91x
ObjectiveCBridgeStubFromNSDate 3656 4020 +10.0% 0.91x
StrComplexWalk 7385 7870 +6.6% 0.94x
Improvement (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasPrefix 1614 1522 -5.7% 1.06x
ProtocolDispatch 6116 5573 -8.9% 1.10x
PopFrontUnsafePointer 178576 162494 -9.0% 1.10x
StringHasSuffix 1765 1524 -13.7% 1.16x
No Changes (148)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
TypeFlood 195 187 -4.1% 1.04x(?)
NSError 695 669 -3.7% 1.04x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 186146 181425 -2.5% 1.03x(?)
ObjectiveCBridgeStubURLAppendPath 238545 231737 -2.9% 1.03x(?)
ArrayOfPOD 1899 1839 -3.2% 1.03x
ObjectiveCBridgeStubToNSDate 13928 13661 -1.9% 1.02x(?)
ObjectiveCBridgeStubDataAppend 3526 3469 -1.6% 1.02x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 127427 125216 -1.7% 1.02x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 91663 90033 -1.8% 1.02x(?)
ObjectiveCBridgeStubFromArrayOfNSString 59114 57808 -2.2% 1.02x(?)
AnyHashableWithAClass 81027 80311 -0.9% 1.01x(?)
ArrayAppendOptionals 1385 1376 -0.7% 1.01x(?)
ErrorHandling 3831 3806 -0.7% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObject 86278 85738 -0.6% 1.01x(?)
PopFrontArrayGeneric 9538 9458 -0.8% 1.01x(?)
StringEqualPointerComparison 9722 9649 -0.8% 1.01x(?)
ObjectiveCBridgeStubToNSStringRef 156 155 -0.6% 1.01x(?)
SetExclusiveOr_OfObjects 39716 39461 -0.6% 1.01x
156 6900715 6856783 -0.6% 1.01x
NSStringConversion 1362 1342 -1.5% 1.01x
ReversedArray 523 517 -1.1% 1.01x
StringBuilder 2788 2759 -1.0% 1.01x(?)
ObjectiveCBridgeStubNSDataAppend 2821 2790 -1.1% 1.01x(?)
ArraySubscript 5644 5639 -0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1136 1135 -0.1% 1.00x(?)
RecursiveOwnedParameter 10907 10911 +0.0% 1.00x(?)
Integrate 365 365 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToString 98740 98979 +0.2% 1.00x(?)
ClassArrayGetter 1273 1274 +0.1% 1.00x(?)
Array2D 816764 815458 -0.2% 1.00x(?)
Histogram 9940 9979 +0.4% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 4110 4091 -0.5% 1.00x(?)
ArrayOfGenericPOD 3076 3074 -0.1% 1.00x(?)
StringWithCString 152743 152978 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 10421 10423 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 3118 3126 +0.3% 1.00x(?)
Prims 12702 12682 -0.2% 1.00x(?)
SortLettersInPlace 2689 2690 +0.0% 1.00x(?)
DictionarySwap 6116 6143 +0.4% 1.00x
ArrayAppendToFromGeneric 717 719 +0.3% 1.00x(?)
PopFrontArray 13686 13682 -0.0% 1.00x(?)
Dictionary3OfObjects 2136 2128 -0.4% 1.00x(?)
RangeAssignment 7169 7165 -0.1% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1374 1369 -0.4% 1.00x(?)
SuperChars 267522 266729 -0.3% 1.00x(?)
ArrayAppendLazyMap 263578 263872 +0.1% 1.00x(?)
ArrayPlusEqualFiveElementCollection 545723 547173 +0.3% 1.00x(?)
XorLoop 19998 20003 +0.0% 1.00x(?)
StringInterpolation 15824 15853 +0.2% 1.00x(?)
ObserverClosure 7037 7038 +0.0% 1.00x(?)
ObjectiveCBridgeStubToNSString 1345 1340 -0.4% 1.00x(?)
ArrayPlusEqualSingleElementCollection 536383 534709 -0.3% 1.00x(?)
ArrayAppendStrings 11895 11899 +0.0% 1.00x(?)
ObjectAllocation 555 555 +0.0% 1.00x
SortSortedStrings 1250 1252 +0.2% 1.00x(?)
ArrayLiteral 1239 1241 +0.2% 1.00x(?)
ProtocolDispatch2 441 443 +0.5% 1.00x
Walsh 13361 13317 -0.3% 1.00x(?)
Dictionary3 1376 1376 +0.0% 1.00x
Dictionary2 3672 3667 -0.1% 1.00x(?)
SetIntersect_OfObjects 11858 11882 +0.2% 1.00x(?)
Join 1482 1478 -0.3% 1.00x(?)
ArrayOfRef 8920 8902 -0.2% 1.00x(?)
ObserverUnappliedMethod 8726 8728 +0.0% 1.00x(?)
ArrayPlusEqualArrayOfInt 716 717 +0.1% 1.00x(?)
DictionaryOfObjects 4628 4633 +0.1% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3328 3341 +0.4% 1.00x(?)
CaptureProp 100399 100417 +0.0% 1.00x(?)
PolymorphicCalls 687 686 -0.1% 1.00x(?)
RC4 9386 9380 -0.1% 1.00x(?)
ArrayAppendFromGeneric 719 721 +0.3% 1.00x
MapReduce 44818 44856 +0.1% 1.00x(?)
IterateData 10068 10107 +0.4% 1.00x
DictionaryLiteral 15927 15891 -0.2% 1.00x(?)
DictionaryRemoveOfObjects 47995 47977 -0.0% 1.00x(?)
UTF8Decode 46246 46018 -0.5% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 112394 111997 -0.3% 1.00x(?)
SetIsSubsetOf 1906 1909 +0.2% 1.00x(?)
Dictionary 1864 1859 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 77710 77628 -0.1% 1.00x(?)
SetExclusiveOr 20812 20846 +0.2% 1.00x(?)
NSDictionaryCastToSwift 6277 6305 +0.5% 1.00x(?)
RGBHistogramOfObjects 83220 83134 -0.1% 1.00x(?)
StrToInt 5776 5780 +0.1% 1.00x(?)
ArrayInClass 3956 3959 +0.1% 1.00x(?)
ArrayOfGenericRef 9931 9925 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSString 4559 4581 +0.5% 1.00x(?)
Sim2DArray 14769 14778 +0.1% 1.00x(?)
ArrayAppendRepeatCol 215641 215794 +0.1% 1.00x(?)
ObjectiveCBridgeToNSDictionary 61285 61144 -0.2% 1.00x(?)
MonteCarloPi 53648 53592 -0.1% 1.00x(?)
MonteCarloE 108527 108457 -0.1% 1.00x(?)
SetUnion_OfObjects 28451 28435 -0.1% 1.00x(?)
HashTest 5502 5506 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 1885 1880 -0.3% 1.00x(?)
DictionaryRemove 18157 18157 +0.0% 1.00x
LinkedList 27951 27962 +0.0% 1.00x(?)
ArrayAppendSequence 84181 84511 +0.4% 1.00x(?)
SetUnion 12233 12257 +0.2% 1.00x(?)
ObserverForwarderStruct 5263 5271 +0.1% 1.00x
ArrayAppendArrayOfInt 715 714 -0.1% 1.00x(?)
SevenBoom 1494 1491 -0.2% 1.00x(?)
ObjectiveCBridgeStubNSDateMutationRef 14438 14412 -0.2% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 20946 20973 +0.1% 1.00x
Dictionary2OfObjects 5971 5956 -0.2% 1.00x(?)
ArrayValueProp2 3140 3139 -0.0% 1.00x(?)
ArrayValueProp3 3127 3130 +0.1% 1.00x(?)
ObserverPartiallyAppliedMethod 8387 8407 +0.2% 1.00x(?)
DictionarySwapOfObjects 19990 20184 +1.0% 0.99x(?)
StackPromo 128627 129876 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 170859 171861 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7890 7996 +1.3% 0.99x(?)
StaticArray 3719 3749 +0.8% 0.99x(?)
ObjectiveCBridgeStubURLAppendPathRef 236449 238194 +0.7% 0.99x(?)
Hanoi 19552 19720 +0.9% 0.99x
OpenClose 397 399 +0.5% 0.99x(?)
ObjectiveCBridgeStubToArrayOfNSString 29640 29906 +0.9% 0.99x(?)
SetIntersect 11014 11117 +0.9% 0.99x
Phonebook 20972 21234 +1.2% 0.99x
ReversedBidirectional 131597 133476 +1.4% 0.99x(?)
StringHasSuffixUnicode 65007 65614 +0.9% 0.99x
ArrayAppendToGeneric 718 722 +0.6% 0.99x
ObjectiveCBridgeToNSSet 38098 38327 +0.6% 0.99x(?)
RGBHistogram 34871 35070 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7478 7529 +0.7% 0.99x(?)
DeadArray 120223 120899 +0.6% 0.99x(?)
AngryPhonebook 2998 3031 +1.1% 0.99x(?)
ArrayValueProp 2604 2618 +0.5% 0.99x(?)
ArrayValueProp4 3001 3018 +0.6% 0.99x
TwoSum 4797 4824 +0.6% 0.99x
SortStrings 2456 2499 +1.8% 0.98x
DictionaryBridge 3429 3486 +1.7% 0.98x(?)
ReversedDictionary 32196 32962 +2.4% 0.98x(?)
ObjectiveCBridgeStubFromNSStringRef 157 161 +2.5% 0.98x
ObjectiveCBridgeToNSArray 30363 30871 +1.7% 0.98x(?)
SortStringsUnicode 8177 8322 +1.8% 0.98x
StringHasPrefixUnicode 15175 15446 +1.8% 0.98x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 87415 88818 +1.6% 0.98x(?)
BitCount 96 98 +2.1% 0.98x
ArrayAppend 3338 3451 +3.4% 0.97x
Calculator 984 1017 +3.4% 0.97x
ArrayAppendReserved 3105 3186 +2.6% 0.97x
ObjectiveCBridgeStubFromNSString 791 822 +3.9% 0.96x
ObjectiveCBridgeStubNSDateRefAccess 1198 1258 +5.0% 0.95x
ObjectiveCBridgeStubDateAccess 1064 1125 +5.7% 0.95x
Chars 6582 6895 +4.8% 0.95x
**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

@allevato
Copy link
Member Author

@airspeedswift Sounds good—I'll add some new benchmarks as soon as I have time to work on it again in the next couple of days and send a separate PR for those.

@allevato
Copy link
Member Author

Now that #6879 is merged, do I need to do anything extra to re-run the benchmarks? (When I tried running it on that PR, nothing happened—are the swift-ci commands only available to project collaborators?)

@gottesmm
Copy link
Contributor

@allevato Yes. Let me kick it off for you. I'll do a smoke test as well.

@gottesmm
Copy link
Contributor

@swift-ci Please benchmark

@gottesmm
Copy link
Contributor

@swift-ci Please smoke test

@airspeedswift
Copy link
Member

@swift-ci Please smoke test linux platform

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasPrefix 574 690 +20.2% 0.83x
OpenClose 45 51 +13.3% 0.88x
StringHasSuffix 669 755 +12.8% 0.89x
PopFrontArrayGeneric 1142 1213 +6.2% 0.94x(?)
Improvement (7)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
NopDeinit 21520 20235 -6.0% 1.06x
ObjectiveCBridgeStubFromNSDate 3922 3651 -6.9% 1.07x
ObjectiveCBridgeStubFromNSStringRef 128 118 -7.8% 1.08x
ObjectiveCBridgeStubNSDateRefAccess 320 291 -9.1% 1.10x
ObjectiveCBridgeStubDateAccess 200 172 -14.0% 1.16x
CharacterLiteralsLarge 25261 11052 -56.2% 2.29x
CharacterLiteralsSmall 32101 769 -97.6% 41.74x
No Changes (148)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
RangeAssignment 273 263 -3.7% 1.04x(?)
158 2858570 2782900 -2.6% 1.03x
ObjectiveCBridgeStubFromNSString 719 702 -2.4% 1.02x(?)
CaptureProp 3951 3865 -2.2% 1.02x(?)
ObjectiveCBridgeStubToArrayOfNSString 27973 27495 -1.7% 1.02x(?)
SetExclusiveOr 2730 2679 -1.9% 1.02x
ObjectiveCBridgeToNSString 1024 1015 -0.9% 1.01x(?)
SortStrings 1583 1563 -1.3% 1.01x
DictionaryBridge 3176 3148 -0.9% 1.01x(?)
DictionarySwap 391 389 -0.5% 1.01x
ObjectiveCBridgeFromNSDictionaryAnyObject 154465 153688 -0.5% 1.01x(?)
AnyHashableWithAClass 62086 61656 -0.7% 1.01x(?)
Join 438 433 -1.1% 1.01x
HashTest 1642 1629 -0.8% 1.01x
ObjectiveCBridgeStubURLAppendPathRef 218790 215887 -1.3% 1.01x(?)
StringEqualPointerComparison 6928 6886 -0.6% 1.01x
RC4 156 155 -0.6% 1.01x
ObjectiveCBridgeStubToNSStringRef 110 109 -0.9% 1.01x(?)
NSDictionaryCastToSwift 4737 4700 -0.8% 1.01x(?)
LinkedList 6845 6805 -0.6% 1.01x(?)
SetUnion 2168 2151 -0.8% 1.01x(?)
DeadArray 174 172 -1.1% 1.01x
ObjectiveCBridgeStubNSDataAppend 2299 2286 -0.6% 1.01x(?)
StringWalk 5672 5636 -0.6% 1.01x
ObserverPartiallyAppliedMethod 3238 3191 -1.4% 1.01x(?)
ArraySubscript 1354 1356 +0.1% 1.00x(?)
DictionarySwapOfObjects 5896 5920 +0.4% 1.00x(?)
StackPromo 20450 20379 -0.3% 1.00x(?)
RecursiveOwnedParameter 1828 1826 -0.1% 1.00x(?)
ObjectiveCBridgeStubToNSString 1208 1208 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 163648 162912 -0.5% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 89872 90193 +0.4% 1.00x(?)
ClassArrayGetter 12 12 +0.0% 1.00x
Array2D 1817 1823 +0.3% 1.00x(?)
MonteCarloPi 42589 42462 -0.3% 1.00x(?)
StringWithCString 146295 145609 -0.5% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 5984 6002 +0.3% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2521 2525 +0.2% 1.00x(?)
SortLettersInPlace 979 977 -0.2% 1.00x(?)
ArrayAppendToFromGeneric 564 564 +0.0% 1.00x
Dictionary3OfObjects 818 819 +0.1% 1.00x(?)
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1141 1142 +0.1% 1.00x(?)
ArrayAppendLazyMap 863 863 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 48607 48694 +0.2% 1.00x(?)
XorLoop 333 333 +0.0% 1.00x
ObserverClosure 1851 1855 +0.2% 1.00x(?)
Integrate 225 225 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 45601 45747 +0.3% 1.00x(?)
ArrayAppendStrings 11376 11376 +0.0% 1.00x
ProtocolDispatch 2869 2868 -0.0% 1.00x(?)
ObjectAllocation 145 145 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 75880 76173 +0.4% 1.00x(?)
ArrayLiteral 1123 1125 +0.2% 1.00x(?)
Dictionary3 489 490 +0.2% 1.00x(?)
StrComplexWalk 2703 2716 +0.5% 1.00x(?)
SetIntersect_OfObjects 1367 1366 -0.1% 1.00x(?)
ErrorHandling 2758 2771 +0.5% 1.00x(?)
ArrayOfRef 3363 3351 -0.4% 1.00x(?)
ObserverUnappliedMethod 2200 2200 +0.0% 1.00x
ObjectiveCBridgeToNSSet 35260 35296 +0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 565 565 +0.0% 1.00x
ObjectiveCBridgeToNSArray 28729 28818 +0.3% 1.00x(?)
NSError 307 308 +0.3% 1.00x(?)
DictionaryOfObjects 2147 2156 +0.4% 1.00x(?)
PolymorphicCalls 20 20 +0.0% 1.00x
ArrayAppendReserved 700 700 +0.0% 1.00x
ArrayAppendFromGeneric 565 565 +0.0% 1.00x
MapReduce 322 323 +0.3% 1.00x(?)
ObjectiveCBridgeStubDateMutation 258 258 +0.0% 1.00x
IterateData 2378 2377 -0.0% 1.00x(?)
DictionaryLiteral 1192 1193 +0.1% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
DictionaryRemoveOfObjects 18244 18300 +0.3% 1.00x(?)
ObjectiveCBridgeStubURLAppendPath 218368 217790 -0.3% 1.00x(?)
SetIsSubsetOf 229 230 +0.4% 1.00x
Dictionary 692 690 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 69649 69634 -0.0% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3230 3227 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 109805 110045 +0.2% 1.00x(?)
ArrayAppendOptionals 1141 1141 +0.0% 1.00x
ArrayInClass 59 59 +0.0% 1.00x
ArrayOfGenericRef 3458 3447 -0.3% 1.00x(?)
Sim2DArray 261 261 +0.0% 1.00x
ArrayAppendRepeatCol 716 716 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 57105 56921 -0.3% 1.00x(?)
MonteCarloE 9884 9911 +0.3% 1.00x(?)
ReversedBidirectional 42539 42450 -0.2% 1.00x(?)
StringHasSuffixUnicode 59606 59532 -0.1% 1.00x(?)
ArrayAppendToGeneric 565 565 +0.0% 1.00x
SetIsSubsetOf_OfObjects 292 292 +0.0% 1.00x
ArrayAppend 927 928 +0.1% 1.00x(?)
StringHasPrefixUnicode 13054 13118 +0.5% 1.00x(?)
RGBHistogramOfObjects 20161 20216 +0.3% 1.00x(?)
RGBHistogram 2131 2139 +0.4% 1.00x(?)
ArrayAppendSequence 922 923 +0.1% 1.00x(?)
ArrayAppendArrayOfInt 565 565 +0.0% 1.00x
ArrayOfPOD 156 156 +0.0% 1.00x
Chars 589 589 +0.0% 1.00x
ReversedArray 46 46 +0.0% 1.00x
StringBuilder 1239 1235 -0.3% 1.00x(?)
BitCount 1 1 +0.0% 1.00x
SevenBoom 1276 1276 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 83062 83306 +0.3% 1.00x(?)
ArrayValueProp 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 53184 53352 +0.3% 1.00x(?)
ObjectiveCBridgeStubNSDateMutationRef 11452 11505 +0.5% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 222 222 +0.0% 1.00x
Dictionary2OfObjects 3233 3246 +0.4% 1.00x(?)
ArrayValueProp4 5 5 +0.0% 1.00x
TwoSum 1230 1229 -0.1% 1.00x(?)
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
Histogram 270 274 +1.5% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5128 5184 +1.1% 0.99x(?)
ObjectiveCBridgeStubFromNSDateRef 3764 3790 +0.7% 0.99x
ReversedDictionary 78 79 +1.3% 0.99x(?)
StringInterpolation 10294 10366 +0.7% 0.99x(?)
StaticArray 118 119 +0.8% 0.99x(?)
ProtocolDispatch2 148 150 +1.4% 0.99x
Dictionary2 1906 1917 +0.6% 0.99x(?)
PopFrontUnsafePointer 8605 8660 +0.6% 0.99x(?)
SortStringsUnicode 6845 6941 +1.4% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 100612 101518 +0.9% 0.99x(?)
SetExclusiveOr_OfObjects 6987 7064 +1.1% 0.99x(?)
Walsh 303 306 +1.0% 0.99x
DictionaryRemove 2182 2195 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 75726 76216 +0.7% 0.99x(?)
NSStringConversion 773 781 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4421 4456 +0.8% 0.99x(?)
AngryPhonebook 2655 2673 +0.7% 0.99x(?)
PopFrontArray 1195 1225 +2.5% 0.98x
Prims 688 702 +2.0% 0.98x
SuperChars 198091 201613 +1.8% 0.98x(?)
ObjectiveCBridgeStubToNSDate 12212 12446 +1.9% 0.98x(?)
SortSortedStrings 780 797 +2.2% 0.98x
ObjectiveCBridgeStubToNSDateRef 3051 3106 +1.8% 0.98x(?)
UTF8Decode 262 268 +2.3% 0.98x
SetIntersect 336 342 +1.8% 0.98x(?)
ObjectiveCBridgeFromNSString 1664 1702 +2.3% 0.98x
SetUnion_OfObjects 5847 5938 +1.6% 0.98x(?)
Calculator 33 34 +3.0% 0.97x(?)
Hanoi 3156 3285 +4.1% 0.96x
StrToInt 4871 5056 +3.8% 0.96x
Phonebook 6803 7065 +3.9% 0.96x
ObserverForwarderStruct 880 922 +4.8% 0.95x(?)
**Unoptimized (Onone)**
Regression (7)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
SuperChars 224421 254750 +13.5% 0.88x(?)
BitCount 92 104 +13.0% 0.88x
StringHasSuffix 1438 1617 +12.4% 0.89x
ObjectiveCBridgeStubDateMutation 409 459 +12.2% 0.89x
PopFrontUnsafePointer 153294 168613 +10.0% 0.91x
StringHasPrefix 1437 1546 +7.6% 0.93x
NopDeinit 42483 44991 +5.9% 0.94x
Improvement (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
Calculator 948 877 -7.5% 1.08x
ProtocolDispatch 5774 5273 -8.7% 1.10x
CharacterLiteralsLarge 26251 12323 -53.1% 2.13x
CharacterLiteralsSmall 33473 919 -97.2% 36.42x
No Changes (148)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
TypeFlood 205 195 -4.9% 1.05x(?)
SortStrings 2382 2299 -3.5% 1.04x
OpenClose 406 391 -3.7% 1.04x(?)
NSError 663 643 -3.0% 1.03x(?)
Phonebook 19944 19429 -2.6% 1.03x
ArrayPlusEqualSingleElementCollection 509291 499131 -2.0% 1.02x(?)
ObjectiveCBridgeStubFromNSString 757 741 -2.1% 1.02x
158 6610013 6491774 -1.8% 1.02x
ObjectiveCBridgeFromNSSetAnyObjectToString 120190 118304 -1.6% 1.02x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 170166 168263 -1.1% 1.01x(?)
DictionarySwap 5900 5866 -0.6% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 160798 159132 -1.0% 1.01x(?)
AnyHashableWithAClass 76506 75660 -1.1% 1.01x(?)
ErrorHandling 3612 3591 -0.6% 1.01x(?)
SortSortedStrings 1189 1179 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObject 81824 81223 -0.7% 1.01x(?)
Join 1374 1367 -0.5% 1.01x(?)
UTF8Decode 43894 43618 -0.6% 1.01x(?)
ObjectiveCBridgeStubToArrayOfNSString 28511 28263 -0.9% 1.01x(?)
NSStringConversion 1320 1312 -0.6% 1.01x(?)
ReversedArray 495 488 -1.4% 1.01x
TwoSum 4632 4603 -0.6% 1.01x
ArraySubscript 5329 5330 +0.0% 1.00x(?)
ObjectiveCBridgeToNSString 1055 1050 -0.5% 1.00x(?)
DictionarySwapOfObjects 18915 18883 -0.2% 1.00x(?)
PopFrontArray 12822 12771 -0.4% 1.00x(?)
RecursiveOwnedParameter 10318 10313 -0.1% 1.00x(?)
Integrate 345 345 +0.0% 1.00x
ClassArrayGetter 1201 1203 +0.2% 1.00x(?)
Array2D 768952 768282 -0.1% 1.00x(?)
Histogram 9822 9849 +0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3861 3864 +0.1% 1.00x(?)
MonteCarloPi 50620 50496 -0.2% 1.00x
StringWithCString 142927 142784 -0.1% 1.00x(?)
Prims 12022 12031 +0.1% 1.00x(?)
SortLettersInPlace 2524 2529 +0.2% 1.00x(?)
ReversedDictionary 30065 30079 +0.1% 1.00x(?)
ArrayAppendToFromGeneric 677 675 -0.3% 1.00x(?)
Dictionary3OfObjects 2032 2027 -0.2% 1.00x(?)
RangeAssignment 6764 6763 -0.0% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1258 1256 -0.2% 1.00x(?)
ArrayAppendLazyMap 260100 259825 -0.1% 1.00x(?)
ArrayPlusEqualFiveElementCollection 517726 515970 -0.3% 1.00x(?)
ObjectiveCBridgeStubToNSDate 13079 13077 -0.0% 1.00x(?)
XorLoop 18993 18984 -0.1% 1.00x(?)
ObserverClosure 6588 6573 -0.2% 1.00x(?)
ArrayAppendOptionals 1257 1260 +0.2% 1.00x(?)
ObjectiveCBridgeStubToNSString 1262 1259 -0.2% 1.00x(?)
ArrayAppendStrings 11115 11128 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 155 155 +0.0% 1.00x
StaticArray 3487 3490 +0.1% 1.00x(?)
AngryPhonebook 2865 2865 +0.0% 1.00x
Walsh 12489 12508 +0.1% 1.00x(?)
Dictionary3 1314 1319 +0.4% 1.00x(?)
Dictionary2 3417 3426 +0.3% 1.00x(?)
SetIntersect_OfObjects 11253 11295 +0.4% 1.00x(?)
ArrayOfRef 8416 8427 +0.1% 1.00x(?)
ObserverUnappliedMethod 8184 8196 +0.1% 1.00x(?)
ObjectiveCBridgeStubURLAppendPathRef 218879 218626 -0.1% 1.00x(?)
ObjectiveCBridgeToNSSet 35841 35980 +0.4% 1.00x(?)
ArrayPlusEqualArrayOfInt 673 673 +0.0% 1.00x
ObjectiveCBridgeToNSArray 29414 29431 +0.1% 1.00x(?)
DictionaryOfObjects 4359 4358 -0.0% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3136 3148 +0.4% 1.00x(?)
PopFrontArrayGeneric 8940 8933 -0.1% 1.00x(?)
PolymorphicCalls 648 648 +0.0% 1.00x
RC4 8861 8857 -0.1% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 147 147 +0.0% 1.00x
ArrayAppendFromGeneric 676 676 +0.0% 1.00x
MapReduce 42525 42477 -0.1% 1.00x(?)
IterateData 10193 10159 -0.3% 1.00x
DictionaryLiteral 15138 15125 -0.1% 1.00x(?)
Hanoi 18461 18398 -0.3% 1.00x
ArrayOfGenericPOD 2896 2894 -0.1% 1.00x(?)
DictionaryRemoveOfObjects 45623 45527 -0.2% 1.00x(?)
SortStringsUnicode 7831 7850 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 105911 106121 +0.2% 1.00x(?)
SetIsSubsetOf 1943 1942 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 72546 72765 +0.3% 1.00x(?)
SetIntersect 11527 11520 -0.1% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3308 3294 -0.4% 1.00x(?)
SetExclusiveOr 20483 20576 +0.5% 1.00x(?)
NSDictionaryCastToSwift 5941 5925 -0.3% 1.00x(?)
RGBHistogramOfObjects 78779 78796 +0.0% 1.00x(?)
ArrayInClass 3754 3755 +0.0% 1.00x(?)
ArrayOfGenericRef 9330 9366 +0.4% 1.00x
ObjectiveCBridgeFromNSString 4412 4414 +0.1% 1.00x(?)
ObjectiveCBridgeStubDateAccess 1033 1033 +0.0% 1.00x
Sim2DArray 13944 13948 +0.0% 1.00x(?)
SetExclusiveOr_OfObjects 37111 37195 +0.2% 1.00x(?)
ArrayAppendRepeatCol 200908 200400 -0.2% 1.00x
ObjectiveCBridgeToNSDictionary 57784 57579 -0.3% 1.00x(?)
MonteCarloE 102184 102168 -0.0% 1.00x(?)
SetUnion_OfObjects 26837 26860 +0.1% 1.00x(?)
StringHasSuffixUnicode 61831 61555 -0.5% 1.00x
ArrayAppendToGeneric 677 678 +0.1% 1.00x(?)
HashTest 5208 5204 -0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 1747 1746 -0.1% 1.00x(?)
ArrayAppend 3246 3236 -0.3% 1.00x
DictionaryRemove 17236 17231 -0.0% 1.00x(?)
LinkedList 26362 26387 +0.1% 1.00x(?)
RGBHistogram 33244 33215 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7070 7044 -0.4% 1.00x(?)
ArrayAppendSequence 73137 72831 -0.4% 1.00x(?)
SetUnion 11452 11475 +0.2% 1.00x(?)
StrToInt 5028 5039 +0.2% 1.00x(?)
ObserverForwarderStruct 4905 4913 +0.2% 1.00x(?)
ObjectiveCBridgeStubNSDataAppend 2637 2635 -0.1% 1.00x(?)
ArrayAppendArrayOfInt 673 673 +0.0% 1.00x
SevenBoom 1422 1420 -0.1% 1.00x(?)
ArrayValueProp 2471 2471 +0.0% 1.00x
GlobalClass 0 0 +0.0% 1.00x
Memset 19793 19785 -0.0% 1.00x(?)
Dictionary2OfObjects 5512 5536 +0.4% 1.00x(?)
ArrayValueProp2 2958 2953 -0.2% 1.00x(?)
ArrayValueProp3 2914 2927 +0.5% 1.00x
ObjectiveCBridgeStubFromNSDate 3673 3691 +0.5% 1.00x(?)
ObserverPartiallyAppliedMethod 7860 7862 +0.0% 1.00x(?)
DictionaryBridge 3215 3262 +1.5% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7528 7634 +1.4% 0.99x(?)
ObjectiveCBridgeFromNSStringForced 2899 2932 +1.1% 0.99x
StringInterpolation 14105 14276 +1.2% 0.99x
ObjectAllocation 525 529 +0.8% 0.99x(?)
ProtocolDispatch2 416 419 +0.7% 0.99x
CaptureProp 114676 115734 +0.9% 0.99x(?)
ObjectiveCBridgeStubURLAppendPath 216732 218994 +1.0% 0.99x(?)
Dictionary 1745 1760 +0.9% 0.99x(?)
StringBuilder 2572 2586 +0.5% 0.99x(?)
ReversedBidirectional 124020 124834 +0.7% 0.99x(?)
DeadArray 110845 112101 +1.1% 0.99x(?)
ArrayLiteral 1167 1178 +0.9% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 84881 85991 +1.3% 0.99x(?)
StringWalk 21703 21920 +1.0% 0.99x
ArrayValueProp4 2853 2868 +0.5% 0.99x(?)
StackPromo 122118 124120 +1.6% 0.98x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 91801 93595 +1.9% 0.98x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 9778 9946 +1.7% 0.98x(?)
StrComplexWalk 7194 7342 +2.1% 0.98x
StringEqualPointerComparison 9083 9253 +1.9% 0.98x
ObjectiveCBridgeStubNSDateRefAccess 1160 1186 +2.2% 0.98x
StringHasPrefixUnicode 14111 14381 +1.9% 0.98x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 81338 83028 +2.1% 0.98x(?)
ObjectiveCBridgeStubFromArrayOfNSString 53524 54343 +1.5% 0.98x(?)
ArrayAppendReserved 3007 3116 +3.6% 0.97x
ArrayOfPOD 1735 1790 +3.2% 0.97x
Chars 6085 6353 +4.4% 0.96x
ObjectiveCBridgeStubNSDateMutationRef 13077 13807 +5.6% 0.95x(?)
**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

@allevato
Copy link
Member Author

Wonderful! Those improvements jibe with what I observed locally.

Are the regressions shown there something I should look into, or is it statistical noise/within tolerance?

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test Linux

@slavapestov
Copy link
Contributor

@allevato We can always just run the benchmarks again :-)

@slavapestov
Copy link
Contributor

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ClassArrayGetter 12 13 +8.3% 0.92x(?)
Hanoi 3194 3445 +7.9% 0.93x
Calculator 33 35 +6.1% 0.94x(?)
Phonebook 7049 7461 +5.8% 0.94x
Improvement (7)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
PopFrontUnsafePointer 9582 9056 -5.5% 1.06x(?)
ObjectiveCBridgeStubNSDateRefAccess 339 308 -9.1% 1.10x
OpenClose 54 48 -11.1% 1.12x
StringHasSuffix 800 716 -10.5% 1.12x
StringHasPrefix 731 608 -16.8% 1.20x
CharacterLiteralsLarge 26469 12018 -54.6% 2.20x
CharacterLiteralsSmall 33748 815 -97.6% 41.41x
No Changes (148)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
RangeAssignment 292 278 -4.8% 1.05x
AnyHashableWithAClass 67309 64392 -4.3% 1.05x(?)
ObjectiveCBridgeStubDateAccess 221 212 -4.1% 1.04x
NopDeinit 22056 21437 -2.8% 1.03x
Array2D 1933 1909 -1.2% 1.01x(?)
StringWithCString 155198 154375 -0.5% 1.01x(?)
ReversedDictionary 92 91 -1.1% 1.01x(?)
ArrayAppendGenericStructs 1241 1233 -0.6% 1.01x(?)
ObjectiveCBridgeStubToNSDate 13101 12995 -0.8% 1.01x(?)
Join 467 463 -0.9% 1.01x(?)
ObjectAllocation 154 153 -0.7% 1.01x(?)
AngryPhonebook 2867 2832 -1.2% 1.01x(?)
ProtocolDispatch2 159 158 -0.6% 1.01x
Walsh 324 321 -0.9% 1.01x(?)
ArrayAppend 990 983 -0.7% 1.01x
ObjectiveCBridgeStubToNSDateRef 3300 3279 -0.6% 1.01x(?)
ObjectiveCBridgeStubToNSStringRef 117 116 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 107582 106935 -0.6% 1.01x(?)
ObjectiveCBridgeStubDataAppend 3448 3429 -0.6% 1.01x(?)
SetExclusiveOr 2868 2847 -0.7% 1.01x(?)
HashTest 1734 1722 -0.7% 1.01x(?)
Chars 625 618 -1.1% 1.01x
ObjectiveCBridgeStubNSDataAppend 2420 2397 -0.9% 1.01x(?)
ArrayLiteral 1192 1184 -0.7% 1.01x(?)
TwoSum 1328 1310 -1.4% 1.01x(?)
ArraySubscript 1428 1429 +0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1077 1080 +0.3% 1.00x(?)
StackPromo 21553 21570 +0.1% 1.00x(?)
RecursiveOwnedParameter 1935 1934 -0.1% 1.00x(?)
ObjectiveCBridgeStubToNSString 1282 1282 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 173118 173181 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 95103 95383 +0.3% 1.00x(?)
SortStrings 1656 1661 +0.3% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5430 5451 +0.4% 1.00x(?)
MonteCarloPi 44961 44995 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 6193 6170 -0.4% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2674 2673 -0.0% 1.00x(?)
SortLettersInPlace 1035 1038 +0.3% 1.00x(?)
DictionarySwap 414 414 +0.0% 1.00x
ArrayAppendToFromGeneric 599 599 +0.0% 1.00x
PopFrontArray 1131 1131 +0.0% 1.00x
Dictionary3OfObjects 869 871 +0.2% 1.00x(?)
ByteSwap 1 1 +0.0% 1.00x
SuperChars 208160 209202 +0.5% 1.00x(?)
ArrayAppendLazyMap 917 913 -0.4% 1.00x(?)
ArrayPlusEqualFiveElementCollection 52132 52278 +0.3% 1.00x(?)
XorLoop 352 353 +0.3% 1.00x(?)
ArrayAppendReserved 742 742 +0.0% 1.00x
ObserverClosure 1978 1982 +0.2% 1.00x(?)
Integrate 238 238 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 48441 48478 +0.1% 1.00x(?)
ArrayAppendStrings 12111 12101 -0.1% 1.00x(?)
ProtocolDispatch 3040 3039 -0.0% 1.00x(?)
TypeFlood 0 0 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 80230 80124 -0.1% 1.00x(?)
Dictionary3 522 521 -0.2% 1.00x(?)
StrComplexWalk 2878 2882 +0.1% 1.00x(?)
SetIntersect_OfObjects 1447 1451 +0.3% 1.00x(?)
ErrorHandling 2927 2932 +0.2% 1.00x(?)
ArrayOfRef 3606 3604 -0.1% 1.00x(?)
ObserverUnappliedMethod 2364 2367 +0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 599 599 +0.0% 1.00x
NSError 326 326 +0.0% 1.00x
DictionaryOfObjects 2283 2286 +0.1% 1.00x(?)
PopFrontArrayGeneric 1128 1125 -0.3% 1.00x(?)
StringEqualPointerComparison 7305 7301 -0.1% 1.00x(?)
CaptureProp 4564 4561 -0.1% 1.00x(?)
RC4 165 165 +0.0% 1.00x
ArrayAppendFromGeneric 599 599 +0.0% 1.00x
MapReduce 341 342 +0.3% 1.00x(?)
ObjectiveCBridgeStubDateMutation 273 273 +0.0% 1.00x
IterateData 2609 2616 +0.3% 1.00x(?)
DictionaryLiteral 1267 1265 -0.2% 1.00x(?)
ArrayOfGenericPOD 220 220 +0.0% 1.00x
DictionaryRemoveOfObjects 19400 19418 +0.1% 1.00x(?)
ObjectiveCBridgeStubURLAppendPath 230446 230686 +0.1% 1.00x(?)
SetIsSubsetOf 243 243 +0.0% 1.00x
ObjectiveCBridgeStubToArrayOfNSString 29511 29484 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 73395 73646 +0.3% 1.00x(?)
NSDictionaryCastToSwift 4926 4938 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 114889 114836 -0.1% 1.00x(?)
ArrayInClass 63 63 +0.0% 1.00x
ArrayOfGenericRef 3686 3677 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSString 1755 1760 +0.3% 1.00x(?)
Sim2DArray 277 277 +0.0% 1.00x
ArrayAppendRepeatCol 759 759 +0.0% 1.00x
ReversedBidirectional 44947 44907 -0.1% 1.00x(?)
ArrayAppendToGeneric 599 599 +0.0% 1.00x
SetIsSubsetOf_OfObjects 309 310 +0.3% 1.00x(?)
ObjectiveCBridgeToNSSet 37225 37075 -0.4% 1.00x(?)
LinkedList 7255 7256 +0.0% 1.00x(?)
158 2992062 2978393 -0.5% 1.00x
RGBHistogramOfObjects 21473 21431 -0.2% 1.00x(?)
RGBHistogram 2251 2250 -0.0% 1.00x(?)
ArrayAppendSequence 978 978 +0.0% 1.00x
ArrayAppendArrayOfInt 600 599 -0.2% 1.00x(?)
ArrayOfPOD 165 165 +0.0% 1.00x
ReversedArray 49 49 +0.0% 1.00x
StringBuilder 1309 1307 -0.1% 1.00x(?)
ObserverForwarderStruct 895 898 +0.3% 1.00x(?)
BitCount 1 1 +0.0% 1.00x
ArrayValueProp3 6 6 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 87951 87631 -0.4% 1.00x(?)
ArrayValueProp 6 6 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 56455 56460 +0.0% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 235 235 +0.0% 1.00x
Dictionary2OfObjects 3436 3435 -0.0% 1.00x(?)
ArrayValueProp4 6 6 +0.0% 1.00x
ArrayValueProp2 6 6 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDate 3856 3840 -0.4% 1.00x(?)
ObserverPartiallyAppliedMethod 3379 3369 -0.3% 1.00x(?)
DictionarySwapOfObjects 6233 6275 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 162907 164227 +0.8% 0.99x(?)
Histogram 286 290 +1.4% 0.99x
DictionaryBridge 3314 3339 +0.8% 0.99x(?)
StringInterpolation 10843 10917 +0.7% 0.99x(?)
StaticArray 125 126 +0.8% 0.99x(?)
Dictionary2 2021 2034 +0.6% 0.99x(?)
ObjectiveCBridgeStubURLAppendPathRef 231686 233290 +0.7% 0.99x(?)
ObjectiveCBridgeToNSArray 30367 30596 +0.8% 0.99x(?)
UTF8Decode 283 285 +0.7% 0.99x
Dictionary 728 739 +1.5% 0.99x
ArrayAppendOptionals 1239 1247 +0.7% 0.99x(?)
ObjectiveCBridgeToNSDictionary 59106 59732 +1.1% 0.99x(?)
MonteCarloE 10445 10506 +0.6% 0.99x(?)
SetUnion_OfObjects 6222 6284 +1.0% 0.99x(?)
StringHasSuffixUnicode 62460 63309 +1.4% 0.99x
DictionaryRemove 2295 2309 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 79934 80936 +1.2% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4684 4711 +0.6% 0.99x(?)
StringWalk 5976 6009 +0.6% 0.99x
ObjectiveCBridgeStubNSDateMutationRef 11804 11973 +1.4% 0.99x(?)
SevenBoom 1347 1363 +1.2% 0.99x(?)
ObjectiveCBridgeStubFromNSDateRef 3970 4045 +1.9% 0.98x
SortStringsUnicode 7130 7278 +2.1% 0.98x(?)
SetExclusiveOr_OfObjects 7407 7535 +1.7% 0.98x
SetUnion 2278 2314 +1.6% 0.98x(?)
DeadArray 182 185 +1.6% 0.98x
Prims 734 759 +3.4% 0.97x(?)
ObjectiveCBridgeStubFromNSString 747 771 +3.2% 0.97x
NSStringConversion 813 840 +3.3% 0.97x
StringHasPrefixUnicode 13604 14165 +4.1% 0.96x
ObjectiveCBridgeStubFromNSStringRef 125 131 +4.8% 0.95x
SortSortedStrings 802 848 +5.7% 0.95x
PolymorphicCalls 21 22 +4.8% 0.95x
SetIntersect 351 371 +5.7% 0.95x
StrToInt 5103 5359 +5.0% 0.95x
**Unoptimized (Onone)**
Regression (3)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubDateMutation 435 486 +11.7% 0.90x
StringHasPrefix 1638 1736 +6.0% 0.94x
NopDeinit 44789 47438 +5.9% 0.94x
Improvement (7)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
TypeFlood 187 177 -5.3% 1.06x(?)
StringHasSuffix 1709 1617 -5.4% 1.06x
ObjectiveCBridgeStubFromNSDate 3967 3688 -7.0% 1.08x
ProtocolDispatch 6198 5616 -9.4% 1.10x
PopFrontUnsafePointer 180233 162656 -9.8% 1.11x
CharacterLiteralsLarge 27630 12748 -53.9% 2.17x
CharacterLiteralsSmall 35666 976 -97.3% 36.54x
No Changes (149)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
Calculator 992 943 -4.9% 1.05x
SortStrings 2556 2473 -3.2% 1.03x
StrComplexWalk 7822 7617 -2.6% 1.03x
ObjectiveCBridgeStubURLAppendPathRef 237897 231359 -2.8% 1.03x(?)
StackPromo 128264 125858 -1.9% 1.02x(?)
ReversedArray 525 517 -1.5% 1.02x
ObjectiveCBridgeStubNSDateMutationRef 14534 14313 -1.5% 1.02x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 97029 96517 -0.5% 1.01x(?)
DictionaryBridge 3467 3443 -0.7% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 172559 170242 -1.3% 1.01x(?)
StringInterpolation 15106 15016 -0.6% 1.01x(?)
ArrayPlusEqualSingleElementCollection 540135 535662 -0.8% 1.01x(?)
SortSortedStrings 1267 1257 -0.8% 1.01x
ObjectiveCBridgeFromNSSetAnyObject 85327 84637 -0.8% 1.01x(?)
ObjectiveCBridgeToNSSet 37930 37525 -1.1% 1.01x(?)
OpenClose 429 423 -1.4% 1.01x(?)
ObjectiveCBridgeStubToNSDateRef 3361 3328 -1.0% 1.01x(?)
AngryPhonebook 3045 3028 -0.6% 1.01x(?)
NSDictionaryCastToSwift 6122 6071 -0.8% 1.01x(?)
StrToInt 5563 5489 -1.3% 1.01x
Phonebook 21209 20923 -1.4% 1.01x
ArrayAppend 3358 3310 -1.4% 1.01x
158 6903023 6849752 -0.8% 1.01x
ArrayAppendSequence 77891 77060 -1.1% 1.01x(?)
Chars 6580 6488 -1.4% 1.01x
StringBuilder 2754 2734 -0.7% 1.01x(?)
ObjectiveCBridgeStubNSDataAppend 2740 2717 -0.8% 1.01x(?)
BitCount 97 96 -1.0% 1.01x
StringWalk 23306 23007 -1.3% 1.01x
ObjectiveCBridgeStubFromArrayOfNSString 57597 56750 -1.5% 1.01x(?)
ArraySubscript 5642 5642 +0.0% 1.00x
ObjectiveCBridgeToNSString 1118 1115 -0.3% 1.00x(?)
DictionarySwapOfObjects 19907 19921 +0.1% 1.00x(?)
RecursiveOwnedParameter 10899 10918 +0.2% 1.00x(?)
ObjectiveCBridgeStubToNSString 1334 1333 -0.1% 1.00x(?)
ClassArrayGetter 1273 1274 +0.1% 1.00x(?)
Array2D 815301 814487 -0.1% 1.00x(?)
Histogram 10315 10298 -0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 4078 4069 -0.2% 1.00x(?)
MonteCarloPi 53518 53555 +0.1% 1.00x(?)
StringWithCString 152237 151573 -0.4% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 10379 10406 +0.3% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 3112 3120 +0.3% 1.00x(?)
Prims 12738 12744 +0.1% 1.00x(?)
DictionarySwap 6196 6222 +0.4% 1.00x(?)
ReversedDictionary 32665 32665 +0.0% 1.00x
ArrayAppendToFromGeneric 715 715 +0.0% 1.00x
Dictionary3OfObjects 2137 2147 +0.5% 1.00x(?)
RangeAssignment 7171 7160 -0.1% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
SuperChars 263726 262641 -0.4% 1.00x(?)
ArrayAppendLazyMap 275553 276101 +0.2% 1.00x(?)
ArrayPlusEqualFiveElementCollection 540973 542420 +0.3% 1.00x(?)
XorLoop 20140 20118 -0.1% 1.00x(?)
ArrayAppendReserved 3082 3096 +0.5% 1.00x
ObserverClosure 6959 6977 +0.3% 1.00x(?)
ArrayAppendOptionals 1385 1385 +0.0% 1.00x
Integrate 366 365 -0.3% 1.00x(?)
ArrayAppendStrings 11861 11873 +0.1% 1.00x(?)
StaticArray 3703 3717 +0.4% 1.00x(?)
ArrayLiteral 1242 1246 +0.3% 1.00x(?)
ProtocolDispatch2 441 443 +0.5% 1.00x
Walsh 13215 13273 +0.4% 1.00x(?)
Dictionary3 1382 1385 +0.2% 1.00x(?)
Dictionary2 3625 3624 -0.0% 1.00x(?)
SetIntersect_OfObjects 11879 11864 -0.1% 1.00x(?)
Join 1455 1459 +0.3% 1.00x(?)
ArrayOfRef 8969 8943 -0.3% 1.00x(?)
ObserverUnappliedMethod 8717 8685 -0.4% 1.00x(?)
ArrayPlusEqualArrayOfInt 717 714 -0.4% 1.00x
DictionaryOfObjects 4588 4596 +0.2% 1.00x(?)
StringEqualPointerComparison 9678 9679 +0.0% 1.00x(?)
CaptureProp 121784 121976 +0.2% 1.00x
PolymorphicCalls 687 686 -0.1% 1.00x(?)
RC4 9392 9399 +0.1% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 156 156 +0.0% 1.00x
ArrayAppendFromGeneric 717 716 -0.1% 1.00x
MapReduce 45035 45108 +0.2% 1.00x(?)
IterateData 10787 10820 +0.3% 1.00x
DictionaryLiteral 16010 15993 -0.1% 1.00x(?)
Hanoi 19422 19338 -0.4% 1.00x(?)
DictionaryRemoveOfObjects 48279 48123 -0.3% 1.00x(?)
UTF8Decode 45898 45760 -0.3% 1.00x(?)
SortStringsUnicode 8297 8290 -0.1% 1.00x(?)
SetIsSubsetOf 2047 2047 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 76702 76331 -0.5% 1.00x(?)
SetExclusiveOr 21622 21673 +0.2% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectToString 125963 125984 +0.0% 1.00x(?)
ArrayInClass 3979 3977 -0.1% 1.00x(?)
ArrayOfGenericRef 9980 9981 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSString 4712 4703 -0.2% 1.00x(?)
ObjectiveCBridgeStubDateAccess 1095 1095 +0.0% 1.00x
Sim2DArray 14782 14782 +0.0% 1.00x
SetExclusiveOr_OfObjects 39437 39499 +0.2% 1.00x(?)
ArrayAppendRepeatCol 211269 211850 +0.3% 1.00x(?)
MonteCarloE 108216 108105 -0.1% 1.00x(?)
SetUnion_OfObjects 28402 28389 -0.1% 1.00x(?)
ArrayAppendToGeneric 719 716 -0.4% 1.00x
HashTest 5511 5530 +0.3% 1.00x(?)
SetIsSubsetOf_OfObjects 1843 1842 -0.1% 1.00x(?)
LinkedList 27896 27944 +0.2% 1.00x(?)
RGBHistogramOfObjects 83950 83708 -0.3% 1.00x(?)
RGBHistogram 35167 35309 +0.4% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7448 7416 -0.4% 1.00x(?)
ArrayAppendArrayOfInt 714 713 -0.1% 1.00x(?)
SetUnion 11967 11950 -0.1% 1.00x(?)
ObserverForwarderStruct 5230 5237 +0.1% 1.00x(?)
AnyHashableWithAClass 80480 80222 -0.3% 1.00x(?)
ArrayValueProp3 3101 3097 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 89033 89294 +0.3% 1.00x(?)
ArrayValueProp 2621 2621 +0.0% 1.00x
GlobalClass 0 0 +0.0% 1.00x
Memset 20960 20963 +0.0% 1.00x(?)
Dictionary2OfObjects 5883 5891 +0.1% 1.00x(?)
ArrayValueProp4 3040 3037 -0.1% 1.00x(?)
TwoSum 4869 4874 +0.1% 1.00x(?)
ArrayValueProp2 3133 3130 -0.1% 1.00x(?)
ObserverPartiallyAppliedMethod 8359 8381 +0.3% 1.00x(?)
PopFrontArray 13526 13609 +0.6% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 183368 185091 +0.9% 0.99x(?)
SortLettersInPlace 2647 2676 +1.1% 0.99x
ErrorHandling 3771 3807 +0.9% 0.99x(?)
ObjectiveCBridgeStubFromNSStringRef 158 159 +0.6% 0.99x(?)
ObjectAllocation 553 556 +0.5% 0.99x(?)
ObjectiveCBridgeToNSArray 30924 31279 +1.1% 0.99x
NSError 684 691 +1.0% 0.99x(?)
PopFrontArrayGeneric 9455 9505 +0.5% 0.99x
ArrayOfGenericPOD 3222 3240 +0.6% 0.99x(?)
ObjectiveCBridgeStubURLAppendPath 232115 233292 +0.5% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 113132 113749 +0.6% 0.99x(?)
SetIntersect 12198 12316 +1.0% 0.99x(?)
ObjectiveCBridgeStubDataAppend 3524 3547 +0.7% 0.99x(?)
ObjectiveCBridgeStubNSDateRefAccess 1220 1228 +0.7% 0.99x
ObjectiveCBridgeToNSDictionary 60595 61278 +1.1% 0.99x(?)
ReversedBidirectional 131711 132770 +0.8% 0.99x
StringHasSuffixUnicode 64492 65120 +1.0% 0.99x
DictionaryRemove 17771 17878 +0.6% 0.99x(?)
NSStringConversion 1331 1340 +0.7% 0.99x(?)
DeadArray 117888 119407 +1.3% 0.99x(?)
SevenBoom 1505 1514 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7984 8116 +1.6% 0.98x(?)
ObjectiveCBridgeStubFromNSString 785 802 +2.2% 0.98x(?)
Dictionary 1838 1866 +1.5% 0.98x(?)
ObjectiveCBridgeStubToArrayOfNSString 29446 30331 +3.0% 0.97x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 85796 88035 +2.6% 0.97x
ArrayOfPOD 1840 1897 +3.1% 0.97x
ArrayAppendGenericStructs 1367 1427 +4.4% 0.96x(?)
ObjectiveCBridgeStubToNSDate 13740 14333 +4.3% 0.96x(?)
StringHasPrefixUnicode 14883 15441 +3.8% 0.96x
**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

@airspeedswift
Copy link
Member

Yeah the second bench run suggests the regressions we are seeing are just jitter, not caused by the change.

I think we can merge this. @dabrahams do you agree?

@airspeedswift airspeedswift merged commit d3728ac into swiftlang:master Jan 26, 2017
@allevato
Copy link
Member Author

Thanks all!

@allevato allevato deleted the character-performance branch January 26, 2017 14:30
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.

6 participants