Skip to content

Conversation

@palimondo
Copy link
Contributor

@palimondo palimondo commented Apr 15, 2017

This PR fixes reporting issues when comparing benchmark results.

Resolves:

  • SR-4590 compare_perf_tests.py fails when new benchmarks are added
  • SR-4597 Benchmark results have wrong MEAN, MEDIAN and SD
  • SR-4598 Add option to run subset of benchmarks matching a prefix
  • SR-4659 Benchmark logs should be tied to tested tree version

@palimondo
Copy link
Contributor Author

palimondo commented Apr 15, 2017

@lplarson Please review. cc @eeckstein @shahmishal @gottesmm @atrick

@palimondo palimondo changed the title Compare performance [WIP] Compare performance Apr 15, 2017
@dabrahams dabrahams requested a review from eeckstein April 15, 2017 18:28
@shahmishal
Copy link
Member

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ExistentialTestArrayConditionalShift_IntValueBuffer0 28983 34907 +20.4% 0.83x
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer1 16192 18748 +15.8% 0.86x
ExistentialTestArrayMutating_IntValueBuffer0 13744 15795 +14.9% 0.87x
ExistentialTestArrayConditionalShift_ClassValueBuffer1 57422 61945 +7.9% 0.93x
Improvement (5)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ExistentialTestArrayOneMethodCall_ClassValueBuffer2 23511 22226 -5.5% 1.06x(?)
ClassArrayGetter 13 12 -7.7% 1.08x
PopFrontArrayGeneric 1192 1036 -13.1% 1.15x
PopFrontArray 1193 1029 -13.8% 1.16x
ReversedDictionary 98 63 -35.7% 1.56x
No Changes (357)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObserverUnappliedMethod 2468 2358 -4.5% 1.05x(?)
ExistentialTestArrayMutating_IntValueBuffer3 15623 14920 -4.5% 1.05x(?)
DropFirstAnyCollection 128 123 -3.9% 1.04x(?)
ObserverPartiallyAppliedMethod 3626 3499 -3.5% 1.04x(?)
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer2 25166 24271 -3.6% 1.04x(?)
ObjectiveCBridgeStubToArrayOfNSString 26438 25645 -3.0% 1.03x(?)
Join 459 447 -2.6% 1.03x(?)
NSDictionaryCastToSwift 5116 4963 -3.0% 1.03x(?)
StringBuilder 1333 1291 -3.1% 1.03x
ExistentialTestArrayConditionalShift_ClassValueBuffer3 115838 113630 -1.9% 1.02x(?)
HashQuadratic 5972231 5883255 -1.5% 1.02x(?)
ReversedBidirectional 46137 45444 -1.5% 1.02x
ObserverClosure 2176 2123 -2.4% 1.02x
DictionaryBridge 2435 2378 -2.3% 1.02x(?)
DropFirstSequence 2893 2849 -1.5% 1.02x(?)
MapReduceSequence 449 439 -2.2% 1.02x
ArraySubscript 1437 1420 -1.2% 1.01x(?)
ObjectiveCBridgeStubURLAppendPathRef 206994 205037 -0.9% 1.01x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer1 66656 65967 -1.0% 1.01x
SuffixAnySequenceLazy 6331 6292 -0.6% 1.01x(?)
MonteCarloE 9955 9841 -1.1% 1.01x(?)
PrefixWhileAnySequence 13411 13305 -0.8% 1.01x(?)
DropLastAnySequence 6296 6226 -1.1% 1.01x(?)
CharacterLiteralsLarge 11661 11559 -0.9% 1.01x
ExistentialTestArrayTwoMethodCalls_IntValueBuffer4 15043 14949 -0.6% 1.01x(?)
Dictionary 766 757 -1.2% 1.01x
ObjectiveCBridgeToNSDictionary 55814 55017 -1.4% 1.01x(?)
PrefixWhileAnySeqCRangeIter 11875 11800 -0.6% 1.01x(?)
ObjectiveCBridgeStubFromNSStringRef 165 163 -1.2% 1.01x
SetIntersect 309 307 -0.7% 1.01x
ExistentialTestArrayOneMethodCall_ClassValueBuffer1 13281 13138 -1.1% 1.01x(?)
ExistentialTestArrayOneMethodCall_ClassValueBuffer3 32844 32544 -0.9% 1.01x(?)
AnyHashableWithAClass 64300 63677 -1.0% 1.01x(?)
StringBuilderLong 908 899 -1.0% 1.01x
Array2D 1958 1939 -1.0% 1.01x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer4 13583 13515 -0.5% 1.01x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer3 5007 4944 -1.3% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4243 4219 -0.6% 1.01x(?)
ErrorHandling 2786 2765 -0.8% 1.01x(?)
ObjectiveCBridgeStubToNSStringRef 104 103 -1.0% 1.01x(?)
MapReduceShort 1853 1840 -0.7% 1.01x
ObjectiveCBridgeStubDataAppend 3495 3475 -0.6% 1.01x(?)
SuffixAnyCollectionLazy 6874 6778 -1.4% 1.01x(?)
SetUnion 2059 2033 -1.3% 1.01x(?)
DropLastAnySequenceLazy 6178 6144 -0.6% 1.01x
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer0 91200 90506 -0.8% 1.01x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer1 90036 89005 -1.1% 1.01x
DropFirstCountableRangeLazy 22 22 +0.0% 1.00x
ObjectiveCBridgeStubToNSString 1439 1432 -0.5% 1.00x
PrefixSequenceLazy 2436 2439 +0.1% 1.00x(?)
PrefixWhileArray 62 62 +0.0% 1.00x
Histogram 227 227 +0.0% 1.00x
SuffixAnySeqCntRange 42 42 +0.0% 1.00x
SortLettersInPlace 1090 1092 +0.2% 1.00x(?)
ExistentialTestArrayConditionalShift_ClassValueBuffer2 85542 85387 -0.2% 1.00x(?)
ExistentialTestArrayConditionalShift_ClassValueBuffer4 57944 58012 +0.1% 1.00x(?)
PrefixWhileAnyCollectionLazy 73 73 +0.0% 1.00x
PrefixAnyCollection 120 120 +0.0% 1.00x
PrefixAnySequenceLazy 5750 5755 +0.1% 1.00x(?)
TypeFlood 0 0 +0.0% 1.00x
StringHasPrefix 662 659 -0.5% 1.00x(?)
SetIntersect_OfObjects 1626 1625 -0.1% 1.00x(?)
ArrayOfRef 3690 3681 -0.2% 1.00x(?)
PrefixSequence 2478 2479 +0.0% 1.00x(?)
PrefixCountableRange 22 22 +0.0% 1.00x
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer2 69296 69472 +0.2% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer3 66192 66420 +0.3% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer0 65152 64921 -0.3% 1.00x(?)
PrefixWhileCountableRange 33 33 +0.0% 1.00x
IterateData 717 717 +0.0% 1.00x
OpenClose 45 45 +0.0% 1.00x
UTF8Decode 258 258 +0.0% 1.00x
SuffixAnySequence 6600 6576 -0.4% 1.00x(?)
SetIsSubsetOf 277 277 +0.0% 1.00x
NopDeinit 21588 21620 +0.1% 1.00x(?)
CStringShortAscii 5978 5988 +0.2% 1.00x(?)
PrefixWhileArrayLazy 54 54 +0.0% 1.00x
ExistentialTestMutating_IntValueBuffer0 12873 12868 -0.0% 1.00x(?)
ExistentialTestMutating_ClassValueBuffer2 17170 17160 -0.1% 1.00x(?)
ExistentialTestMutating_ClassValueBuffer3 17176 17160 -0.1% 1.00x(?)
ExistentialTestMutating_ClassValueBuffer1 17185 17165 -0.1% 1.00x(?)
ExistentialTestMutating_ClassValueBuffer4 38423 38431 +0.0% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 293 293 +0.0% 1.00x
StrToInt 4281 4280 -0.0% 1.00x(?)
StringHasSuffix 752 753 +0.1% 1.00x(?)
PolymorphicCalls 20 20 +0.0% 1.00x
ArrayAppendRepeatCol 790 791 +0.1% 1.00x(?)
DropWhileArrayLazy 75 75 +0.0% 1.00x
ArrayAppendAscii 18898 18897 -0.0% 1.00x(?)
SetUnion_OfObjects 6034 6029 -0.1% 1.00x(?)
PrefixWhileSequence 414 413 -0.2% 1.00x(?)
ArrayAppendToGeneric 563 563 +0.0% 1.00x
Walsh 336 336 +0.0% 1.00x
ExistentialTestMutatingAndNonMutating_IntValueBuffer2 44330 44325 -0.0% 1.00x(?)
SuffixCountableRange 8 8 +0.0% 1.00x
ExistentialTestMutatingAndNonMutating_IntValueBuffer1 41463 41467 +0.0% 1.00x(?)
ArrayAppendSequence 959 958 -0.1% 1.00x(?)
SuffixSequenceLazy 4217 4219 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3432 3431 -0.0% 1.00x(?)
BitCount 0 0 +0.0% 1.00x
AngryPhonebook 2780 2768 -0.4% 1.00x(?)
ExistentialTestOneMethodCall_ClassValueBuffer1 14299 14297 -0.0% 1.00x(?)
ExistentialTestOneMethodCall_ClassValueBuffer3 14299 14298 -0.0% 1.00x(?)
SuffixSequence 4218 4219 +0.0% 1.00x(?)
ArrayValueProp 5 5 +0.0% 1.00x
MapReduceClass 2805 2805 +0.0% 1.00x
SuffixArrayLazy 10 10 +0.0% 1.00x
GlobalClass 0 0 +0.0% 1.00x
DropWhileCountableRange 32 32 +0.0% 1.00x
PrefixAnySeqCntRange 110 110 +0.0% 1.00x
DropWhileSequenceLazy 63 63 +0.0% 1.00x
MonteCarloPi 42339 42341 +0.0% 1.00x(?)
StringAdder 0 0 +0.0% 1.00x
SortStrings 1642 1641 -0.1% 1.00x(?)
DropLastAnySeqCRangeIterLazy 4365 4347 -0.4% 1.00x
ReversedArray 46 46 +0.0% 1.00x
DropLastSequenceLazy 490 489 -0.2% 1.00x(?)
DictionarySwap 347 347 +0.0% 1.00x
MapReduceString 69 69 +0.0% 1.00x
ExistentialTestMutatingAndNonMutating_ClassValueBuffer2 191589 191582 -0.0% 1.00x(?)
ExistentialTestMutatingAndNonMutating_ClassValueBuffer1 114384 114384 +0.0% 1.00x
ExistentialTestArrayTwoMethodCalls_IntValueBuffer2 6879 6873 -0.1% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_IntValueBuffer3 6738 6745 +0.1% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_IntValueBuffer0 6691 6691 +0.0% 1.00x
ExistentialTestArrayTwoMethodCalls_IntValueBuffer1 6870 6870 +0.0% 1.00x
DropFirstArray 28 28 +0.0% 1.00x
SuffixAnySeqCRangeIter 4654 4652 -0.0% 1.00x(?)
ByteSwap 0 0 +0.0% 1.00x
SuperChars 208901 209469 +0.3% 1.00x(?)
ArrayAppendLazyMap 940 942 +0.2% 1.00x(?)
DropLastAnySeqCntRange 42 42 +0.0% 1.00x
DropWhileAnyCollectionLazy 82 82 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 42 42 +0.0% 1.00x
CharacterLiteralsSmall 128 128 +0.0% 1.00x
LazilyFilteredRange 6620 6620 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 730 729 -0.1% 1.00x(?)
ExistentialTestOneMethodCall_IntValueBuffer0 12868 12868 +0.0% 1.00x
ExistentialTestOneMethodCall_IntValueBuffer1 12871 12868 -0.0% 1.00x(?)
ExistentialTestOneMethodCall_IntValueBuffer2 12876 12871 -0.0% 1.00x(?)
ExistentialTestOneMethodCall_IntValueBuffer4 15776 15794 +0.1% 1.00x(?)
DropLastAnyCollection 49 49 +0.0% 1.00x
ArrayAppendLatin1 42239 42245 +0.0% 1.00x(?)
PrefixAnySeqCRangeIterLazy 19844 19796 -0.2% 1.00x(?)
ArrayPlusEqualArrayOfInt 562 563 +0.2% 1.00x(?)
ObjectiveCBridgeToNSArray 26868 26983 +0.4% 1.00x(?)
ExistentialTestMutating_IntValueBuffer3 20074 20075 +0.0% 1.00x(?)
ExistentialTestMutating_IntValueBuffer2 17379 17373 -0.0% 1.00x(?)
ExistentialTestMutating_IntValueBuffer1 15696 15695 -0.0% 1.00x(?)
CStringLongAscii 14305 14295 -0.1% 1.00x(?)
ExistentialTestMutating_IntValueBuffer4 48010 48012 +0.0% 1.00x(?)
Calculator 33 33 +0.0% 1.00x
PrefixWhileSequenceLazy 32 32 +0.0% 1.00x
ArrayOfGenericPOD 207 207 +0.0% 1.00x
MapReduceLazySequence 85 85 +0.0% 1.00x
SetExclusiveOr 2378 2380 +0.1% 1.00x(?)
ArrayInClass 58 58 +0.0% 1.00x
Phonebook 7048 7049 +0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_IntValueBuffer2 24307 24306 -0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_IntValueBuffer3 24308 24305 -0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_IntValueBuffer0 24309 24306 -0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_IntValueBuffer1 27166 27167 +0.0% 1.00x(?)
MapReduceShortString 17 17 +0.0% 1.00x
DropFirstArrayLazy 28 28 +0.0% 1.00x
ExistentialTestArrayMutating_IntValueBuffer4 17248 17228 -0.1% 1.00x(?)
ExistentialTestArrayMutating_IntValueBuffer2 13385 13384 -0.0% 1.00x(?)
ExistentialTestArrayMutating_IntValueBuffer1 13920 13925 +0.0% 1.00x(?)
ArrayAppend 730 730 +0.0% 1.00x
DictionaryRemove 2956 2961 +0.2% 1.00x(?)
TwoSum 816 819 +0.4% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer4 204467 204445 -0.0% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer3 504472 504496 +0.0% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer2 345141 345056 -0.0% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer1 212410 212419 +0.0% 1.00x(?)
CStringLongNonAscii 4091 4093 +0.1% 1.00x(?)
ArrayLiteral 1152 1152 +0.0% 1.00x
DropLastCountableRange 8 8 +0.0% 1.00x
ExistentialTestTwoMethodCalls_IntValueBuffer4 33759 33762 +0.0% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3422 3421 -0.0% 1.00x(?)
RecursiveOwnedParameter 2189 2192 +0.1% 1.00x(?)
ExistentialTestArrayShift_IntValueBuffer4 3123 3121 -0.1% 1.00x(?)
ExistentialTestArrayShift_IntValueBuffer3 3531 3527 -0.1% 1.00x(?)
ExistentialTestArrayShift_IntValueBuffer2 3663 3663 +0.0% 1.00x
ExistentialTestArrayShift_IntValueBuffer1 3123 3123 +0.0% 1.00x
ExistentialTestArrayShift_IntValueBuffer0 3124 3121 -0.1% 1.00x(?)
SuffixAnyCollection 49 49 +0.0% 1.00x
PrefixAnyCollectionLazy 20370 20406 +0.2% 1.00x(?)
DropFirstCountableRange 22 22 +0.0% 1.00x
ArrayAppendToFromGeneric 562 563 +0.2% 1.00x(?)
MapReduceLazyCollectionShort 41 41 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1136 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 4454 4454 +0.0% 1.00x
SuffixCountableRangeLazy 8 8 +0.0% 1.00x
ProtocolDispatch 2287 2287 +0.0% 1.00x
StringEdits 498368 498384 +0.0% 1.00x(?)
Dictionary3 563 561 -0.4% 1.00x
Dictionary2 2005 1999 -0.3% 1.00x(?)
ExistentialTestArrayMutating_ClassValueBuffer2 13391 13379 -0.1% 1.00x(?)
ExistentialTestArrayMutating_ClassValueBuffer3 13397 13379 -0.1% 1.00x(?)
ExistentialTestArrayMutating_ClassValueBuffer4 15959 15939 -0.1% 1.00x(?)
ArrayAppendOptionals 1136 1136 +0.0% 1.00x
DropLastArray 10 10 +0.0% 1.00x
StringEqualPointerComparison 6863 6865 +0.0% 1.00x(?)
CaptureProp 4376 4376 +0.0% 1.00x
MapReduce 316 316 +0.0% 1.00x
PrefixArrayLazy 27 27 +0.0% 1.00x
DictionaryLiteral 1390 1391 +0.1% 1.00x(?)
Hanoi 3268 3262 -0.2% 1.00x(?)
PrefixAnySequence 5739 5745 +0.1% 1.00x(?)
PrefixWhileAnySeqCntRange 145 145 +0.0% 1.00x
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer1 237446 237431 -0.0% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer3 520361 520387 +0.0% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer2 351527 351604 +0.0% 1.00x(?)
LazilyFilteredArrays 68879 68758 -0.2% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer4 230335 230324 -0.0% 1.00x(?)
DropWhileAnySeqCntRangeLazy 82 82 +0.0% 1.00x
ExistentialTestTwoMethodCalls_ClassValueBuffer3 27167 27164 -0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_ClassValueBuffer2 25737 25736 -0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_ClassValueBuffer1 27166 27165 -0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_ClassValueBuffer4 33790 33767 -0.1% 1.00x(?)
ExistentialTestArrayOneMethodCall_ClassValueBuffer4 13736 13710 -0.2% 1.00x(?)
SetIsSubsetOf_OfObjects 337 337 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 42 42 +0.0% 1.00x
DropWhileAnySequence 7139 7143 +0.1% 1.00x(?)
MapReduceAnyCollection 323 323 +0.0% 1.00x
StringMatch 33693 33652 -0.1% 1.00x(?)
DropLastArrayLazy 10 10 +0.0% 1.00x
MapReduceLazyCollection 14 14 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 3967 3981 +0.3% 1.00x(?)
DropFirstAnyCollectionLazy 20532 20556 +0.1% 1.00x(?)
ArrayOfPOD 156 156 +0.0% 1.00x
Chars 1378 1378 +0.0% 1.00x
DropWhileCountableRangeLazy 77 77 +0.0% 1.00x
DropWhileSequence 2950 2951 +0.0% 1.00x(?)
StringWalk 5752 5752 +0.0% 1.00x
RC4 149 149 +0.0% 1.00x
ArrayValueProp4 5 5 +0.0% 1.00x
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer4 211611 211592 -0.0% 1.00x(?)
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
DropLastSequence 491 491 +0.0% 1.00x
DictionarySwapOfObjects 6548 6562 +0.2% 1.00x(?)
StackPromo 20803 20816 +0.1% 1.00x(?)
PrefixWhileAnySequenceLazy 1497 1497 +0.0% 1.00x
DropWhileAnySeqCRangeIterLazy 82 82 +0.0% 1.00x
Integrate 247 247 +0.0% 1.00x
DropLastAnyCollectionLazy 6868 6836 -0.5% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer4 15195 15211 +0.1% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer3 34492 34501 +0.0% 1.00x(?)
PrefixAnySeqCRangeIter 19841 19778 -0.3% 1.00x(?)
ExistentialTestMutatingAndNonMutating_ClassValueBuffer3 264510 264473 -0.0% 1.00x(?)
PrefixWhileAnyCollection 153 153 +0.0% 1.00x
ExistentialTestArrayOneMethodCall_IntValueBuffer0 4855 4856 +0.0% 1.00x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer1 4887 4880 -0.1% 1.00x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer2 5254 5245 -0.2% 1.00x(?)
DropWhileAnySequenceLazy 1988 1989 +0.1% 1.00x(?)
DictionaryRemoveOfObjects 22010 21976 -0.1% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer4 56736 56820 +0.1% 1.00x(?)
DropWhileAnyCollection 127 127 +0.0% 1.00x
ExistentialTestMutatingAndNonMutating_ClassValueBuffer4 134407 134389 -0.0% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer1 29393 29333 -0.2% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer2 29779 29782 +0.0% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer3 30625 30610 -0.1% 1.00x(?)
Dictionary3OfObjects 996 994 -0.2% 1.00x(?)
PrefixAnySeqCntRangeLazy 110 110 +0.0% 1.00x
XorLoop 328 328 +0.0% 1.00x
DropFirstSequenceLazy 2859 2859 +0.0% 1.00x
PrefixArray 27 27 +0.0% 1.00x
ArrayAppendStrings 12802 12792 -0.1% 1.00x(?)
ObjectAllocation 170 170 +0.0% 1.00x
SortSortedStrings 821 821 +0.0% 1.00x
ProtocolDispatch2 151 151 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
NSError 276 277 +0.4% 1.00x(?)
PrefixWhileAnySeqCRangeIterLazy 73 73 +0.0% 1.00x
MapReduceAnyCollectionShort 1944 1936 -0.4% 1.00x(?)
ExistentialTestMutatingAndNonMutating_IntValueBuffer4 146997 147022 +0.0% 1.00x(?)
ArrayAppendFromGeneric 562 563 +0.2% 1.00x(?)
ExistentialTestMutatingAndNonMutating_IntValueBuffer3 44447 44410 -0.1% 1.00x(?)
ExistentialTestMutatingAndNonMutating_IntValueBuffer0 42416 42337 -0.2% 1.00x(?)
DropLastCountableRangeLazy 8 8 +0.0% 1.00x
ArrayAppendUTF16 39265 39258 -0.0% 1.00x(?)
StringInterpolation 8739 8716 -0.3% 1.00x(?)
DropLastAnySeqCRangeIter 4359 4339 -0.5% 1.00x(?)
ExistentialTestArrayShift_ClassValueBuffer4 3121 3122 +0.0% 1.00x(?)
ExistentialTestArrayShift_ClassValueBuffer2 3663 3663 +0.0% 1.00x
ExistentialTestArrayShift_ClassValueBuffer3 3525 3524 -0.0% 1.00x(?)
ExistentialTestArrayShift_ClassValueBuffer1 3122 3123 +0.0% 1.00x(?)
SuffixAnySeqCRangeIterLazy 4653 4653 +0.0% 1.00x
Sim2DArray 260 260 +0.0% 1.00x
StringHasSuffixUnicode 57676 57859 +0.3% 1.00x(?)
HashTest 1645 1642 -0.2% 1.00x(?)
ObjectiveCBridgeToNSSet 33946 33787 -0.5% 1.00x(?)
RGBHistogramOfObjects 22551 22499 -0.2% 1.00x(?)
NSStringConversion 688 689 +0.1% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer3 91053 90605 -0.5% 1.00x(?)
ArrayAppendArrayOfInt 562 562 +0.0% 1.00x
DropFirstAnySeqCntRange 108 108 +0.0% 1.00x
DeadArray 171 171 +0.0% 1.00x
DropWhileArray 40 40 +0.0% 1.00x
SuffixArray 10 10 +0.0% 1.00x
DropFirstAnySequence 6416 6419 +0.1% 1.00x(?)
PrefixWhileAnySeqCntRangeLazy 73 73 +0.0% 1.00x
ObjectiveCBridgeStubNSDateMutationRef 11826 11878 +0.4% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer4 237169 237340 +0.1% 1.00x(?)
Memset 221 220 -0.5% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer2 91011 90918 -0.1% 1.00x(?)
Dictionary2OfObjects 3419 3416 -0.1% 1.00x(?)
ArrayAppendReserved 502 503 +0.2% 1.00x(?)
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
SevenBoom 1395 1394 -0.1% 1.00x(?)
DropWhileAnySeqCntRange 120 121 +0.8% 0.99x
DictionaryOfObjects 2423 2437 +0.6% 0.99x(?)
ObjectiveCBridgeStubToNSDateRef 3139 3183 +1.4% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 75694 76168 +0.6% 0.99x(?)
ArrayOfGenericRef 3770 3792 +0.6% 0.99x(?)
SetExclusiveOr_OfObjects 7408 7473 +0.9% 0.99x(?)
StringHasPrefixUnicode 13688 13815 +0.9% 0.99x
ExistentialTestOneMethodCall_ClassValueBuffer4 15810 15900 +0.6% 0.99x(?)
ExistentialTestOneMethodCall_ClassValueBuffer2 12877 12943 +0.5% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 110042 110786 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 41055 41372 +0.8% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4678 4743 +1.4% 0.99x(?)
StringUTF16Builder 2066 2090 +1.2% 0.99x(?)
ExistentialTestOneMethodCall_IntValueBuffer3 12867 12964 +0.8% 0.99x(?)
RGBHistogram 2299 2328 +1.3% 0.99x(?)
StringWithCString 320067 324232 +1.3% 0.99x(?)
StaticArray 146 147 +0.7% 0.99x(?)
StrComplexWalk 943 949 +0.6% 0.99x
ExistentialTestArrayMutating_ClassValueBuffer1 13386 13474 +0.7% 0.99x
ObjectiveCBridgeFromNSArrayAnyObject 21818 22081 +1.2% 0.99x(?)
LinkedList 6652 6751 +1.5% 0.99x
ObjectiveCBridgeToNSString 1199 1211 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSStringForced 2224 2256 +1.4% 0.99x(?)
DropFirstAnySeqCntRangeLazy 108 109 +0.9% 0.99x
ObjectiveCBridgeFromNSSetAnyObject 59690 60152 +0.8% 0.99x(?)
PopFrontUnsafePointer 8378 8480 +1.2% 0.99x(?)
MapReduceClassShort 4207 4265 +1.4% 0.99x(?)
DropWhileAnySeqCRangeIter 20207 20490 +1.4% 0.99x(?)
ObjectiveCBridgeStubNSDataAppend 2184 2208 +1.1% 0.99x(?)
DropFirstAnySequenceLazy 6383 6442 +0.9% 0.99x
ObjectiveCBridgeStubFromNSString 888 904 +1.8% 0.98x(?)
ObjectiveCBridgeStubURLAppendPath 203673 207118 +1.7% 0.98x(?)
ObjectiveCBridgeFromNSString 1363 1394 +2.3% 0.98x(?)
SortStringsUnicode 7429 7580 +2.0% 0.98x
Prims 710 721 +1.6% 0.98x(?)
RangeAssignment 289 294 +1.7% 0.98x(?)
ObserverForwarderStruct 1031 1056 +2.4% 0.98x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 38238 39031 +2.1% 0.98x(?)
ObjectiveCBridgeStubToNSDate 13503 13887 +2.8% 0.97x(?)
ObjectiveCBridgeStubFromArrayOfNSString 29381 30285 +3.1% 0.97x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 66272 68583 +3.5% 0.97x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 91924 95452 +3.8% 0.96x(?)
PrefixWhileCountableRangeLazy 21 22 +4.8% 0.95x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 92036 96560 +4.9% 0.95x(?)
PrefixCountableRangeLazy 21 22 +4.8% 0.95x
DropFirstAnySeqCRangeIterLazy 25217 26542 +5.2% 0.95x
DropFirstAnySeqCRangeIter 25216 26550 +5.3% 0.95x
**Unoptimized (Onone)**
Regression (5)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeFromNSString 3790 4384 +15.7% 0.86x
PrefixWhileSequenceLazy 9772 10833 +10.9% 0.90x
ObjectiveCBridgeFromNSSetAnyObjectToString 82122 89256 +8.7% 0.92x(?)
ObjectiveCBridgeStubToNSDate 13879 14887 +7.3% 0.93x(?)
TypeFlood 149 159 +6.7% 0.94x(?)
Improvement (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeFromNSArrayAnyObjectForced 7644 7238 -5.3% 1.06x
MapReduceLazyCollectionShort 41447 38785 -6.4% 1.07x
No Changes (359)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
DropWhileArrayLazy 16907 16201 -4.2% 1.04x
ObserverForwarderStruct 4453 4275 -4.0% 1.04x
ExistentialTestOneMethodCall_IntValueBuffer3 39431 38124 -3.3% 1.03x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 100098 97593 -2.5% 1.03x
SetIsSubsetOf_OfObjects 1478 1430 -3.2% 1.03x
NSError 678 660 -2.6% 1.03x(?)
ObjectiveCBridgeStubToArrayOfNSString 26997 26413 -2.2% 1.02x(?)
ArrayAppendSequence 69758 68464 -1.9% 1.02x
ObjectiveCBridgeFromNSDictionaryAnyObject 116194 113555 -2.3% 1.02x
NSDictionaryCastToSwift 6147 6011 -2.2% 1.02x
ReversedDictionary 23307 22888 -1.8% 1.02x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 39695 38954 -1.9% 1.02x
ArraySubscript 3945 3911 -0.9% 1.01x(?)
Histogram 7890 7813 -1.0% 1.01x
ExistentialTestArrayConditionalShift_ClassValueBuffer1 329663 324798 -1.5% 1.01x(?)
PrefixSequence 9964 9907 -0.6% 1.01x(?)
ObjectiveCBridgeStubToNSDateRef 3224 3191 -1.0% 1.01x
UTF8Decode 35591 35200 -1.1% 1.01x
ObjectiveCBridgeStubURLAppendPath 212690 211011 -0.8% 1.01x(?)
DropWhileCountableRangeLazy 24211 23975 -1.0% 1.01x
SuffixCountableRange 112 111 -0.9% 1.01x
PrefixWhileCountableRangeLazy 20114 19845 -1.3% 1.01x
ObserverPartiallyAppliedMethod 7631 7548 -1.1% 1.01x(?)
ArrayAppendLazyMap 197005 195153 -0.9% 1.01x(?)
PrefixAnySeqCRangeIterLazy 22414 22175 -1.1% 1.01x(?)
Join 1250 1235 -1.2% 1.01x(?)
MapReduceLazySequence 22116 21983 -0.6% 1.01x(?)
DropFirstArrayLazy 26021 25885 -0.5% 1.01x
DropFirstAnySeqCRangeIterLazy 27733 27405 -1.2% 1.01x(?)
StaticArray 4376 4328 -1.1% 1.01x
CaptureProp 97219 96319 -0.9% 1.01x
StringBuilder 2666 2646 -0.8% 1.01x(?)
DropWhileAnySequence 15240 15145 -0.6% 1.01x(?)
MapReduceLazyCollection 29654 29354 -1.0% 1.01x
ObjectiveCBridgeFromNSSetAnyObjectForced 6619 6559 -0.9% 1.01x
StringWalk 21221 20924 -1.4% 1.01x
Integrate 375 372 -0.8% 1.01x
PrefixAnySequence 11041 10912 -1.2% 1.01x
Array2D 573559 570542 -0.5% 1.01x
RangeAssignment 5424 5394 -0.6% 1.01x(?)
Dictionary3OfObjects 2133 2121 -0.6% 1.01x
ErrorHandling 3625 3580 -1.2% 1.01x
MapReduceAnyCollectionShort 45098 44868 -0.5% 1.01x
ExistentialTestMutatingAndNonMutating_IntValueBuffer3 274175 270211 -1.4% 1.01x(?)
MapReduceSequence 37397 37189 -0.6% 1.01x(?)
MapReduceShort 44758 44439 -0.7% 1.01x
MapReduceClassShort 48662 48358 -0.6% 1.01x(?)
DeadArray 115567 114137 -1.2% 1.01x(?)
DropFirstAnySequence 13072 12954 -0.9% 1.01x
DropFirstAnySequenceLazy 13055 12927 -1.0% 1.01x
ObjectiveCBridgeStubToNSString 1472 1469 -0.2% 1.00x(?)
PrefixSequenceLazy 9954 9970 +0.2% 1.00x(?)
DropWhileAnySeqCntRange 22607 22696 +0.4% 1.00x
PrefixWhileArray 15831 15867 +0.2% 1.00x
ObjectiveCBridgeStubFromNSDateRef 3752 3750 -0.1% 1.00x(?)
SuffixAnySeqCntRange 5903 5928 +0.4% 1.00x
ExistentialTestArrayConditionalShift_ClassValueBuffer3 400804 400776 -0.0% 1.00x(?)
ExistentialTestArrayConditionalShift_ClassValueBuffer2 361984 361949 -0.0% 1.00x(?)
ExistentialTestArrayConditionalShift_ClassValueBuffer4 338023 337799 -0.1% 1.00x(?)
PrefixAnyCollection 17690 17702 +0.1% 1.00x(?)
SetIntersect_OfObjects 10545 10570 +0.2% 1.00x
ArrayOfRef 8105 8082 -0.3% 1.00x(?)
PrefixCountableRange 319 319 +0.0% 1.00x
DictionaryOfObjects 4452 4447 -0.1% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer2 122371 122792 +0.3% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer3 123262 123264 +0.0% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer1 122074 122362 +0.2% 1.00x(?)
PrefixWhileCountableRange 16134 16122 -0.1% 1.00x
IterateData 9679 9703 +0.2% 1.00x
OpenClose 363 363 +0.0% 1.00x
SuffixAnySequence 25068 25060 -0.0% 1.00x(?)
SuffixAnySequenceLazy 25064 25082 +0.1% 1.00x(?)
CStringShortAscii 8593 8572 -0.2% 1.00x(?)
ExistentialTestMutating_IntValueBuffer0 38731 38675 -0.1% 1.00x(?)
ExistentialTestMutating_ClassValueBuffer2 206961 206959 -0.0% 1.00x(?)
ExistentialTestMutating_ClassValueBuffer3 208539 208445 -0.1% 1.00x
ExistentialTestMutating_ClassValueBuffer1 209173 209129 -0.0% 1.00x(?)
ExistentialTestMutating_ClassValueBuffer4 230663 230859 +0.1% 1.00x
ObjectiveCBridgeStubNSDateRefAccess 1140 1140 +0.0% 1.00x
StrToInt 7181 7163 -0.2% 1.00x
ArrayOfGenericRef 9075 9065 -0.1% 1.00x(?)
StringHasSuffix 1461 1464 +0.2% 1.00x(?)
SetExclusiveOr_OfObjects 38630 38560 -0.2% 1.00x(?)
ArrayAppendRepeatCol 197273 197213 -0.0% 1.00x(?)
ArrayAppendAscii 79437 79443 +0.0% 1.00x(?)
MonteCarloE 78471 78695 +0.3% 1.00x
SetUnion_OfObjects 28026 28022 -0.0% 1.00x(?)
PrefixWhileSequence 26742 26708 -0.1% 1.00x
ArrayAppendToGeneric 620 622 +0.3% 1.00x
Walsh 11226 11227 +0.0% 1.00x(?)
HashQuadratic 45100678 45039842 -0.1% 1.00x(?)
ExistentialTestMutatingAndNonMutating_IntValueBuffer2 204517 204527 +0.0% 1.00x(?)
ReversedBidirectional 133575 132996 -0.4% 1.00x(?)
ExistentialTestMutatingAndNonMutating_IntValueBuffer1 136047 136342 +0.2% 1.00x
SuffixSequenceLazy 24684 24679 -0.0% 1.00x(?)
PrefixWhileAnySequence 27825 27828 +0.0% 1.00x(?)
DropFirstAnyCollection 17644 17715 +0.4% 1.00x(?)
BitCount 90 90 +0.0% 1.00x
AngryPhonebook 2903 2898 -0.2% 1.00x(?)
ExistentialTestOneMethodCall_ClassValueBuffer4 347583 347549 -0.0% 1.00x(?)
ExistentialTestOneMethodCall_ClassValueBuffer1 207647 207622 -0.0% 1.00x(?)
ExistentialTestOneMethodCall_ClassValueBuffer3 354593 354686 +0.0% 1.00x(?)
ExistentialTestOneMethodCall_ClassValueBuffer2 283126 283152 +0.0% 1.00x(?)
SuffixSequence 24708 24704 -0.0% 1.00x(?)
ArrayValueProp 2856 2852 -0.1% 1.00x(?)
MapReduceClass 39601 39752 +0.4% 1.00x
SuffixArrayLazy 8682 8707 +0.3% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
DropWhileCountableRange 5562 5559 -0.1% 1.00x
DropWhileSequenceLazy 10333 10335 +0.0% 1.00x(?)
MonteCarloPi 50448 50452 +0.0% 1.00x(?)
DropLastAnySequence 26423 26358 -0.2% 1.00x
ClassArrayGetter 877 876 -0.1% 1.00x(?)
SortStrings 2634 2647 +0.5% 1.00x(?)
DropLastAnySeqCRangeIterLazy 39550 39520 -0.1% 1.00x
ReversedArray 555 555 +0.0% 1.00x
DropLastSequenceLazy 25994 25961 -0.1% 1.00x
ExistentialTestMutatingAndNonMutating_ClassValueBuffer3 753117 753100 -0.0% 1.00x(?)
ExistentialTestMutatingAndNonMutating_ClassValueBuffer2 607851 607840 -0.0% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_IntValueBuffer4 132677 132759 +0.1% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_IntValueBuffer2 124264 124251 -0.0% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_IntValueBuffer3 125745 125794 +0.0% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_IntValueBuffer0 123196 123251 +0.0% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_IntValueBuffer1 123562 123446 -0.1% 1.00x(?)
DropFirstArray 5843 5845 +0.0% 1.00x
StringUTF16Builder 3496 3508 +0.3% 1.00x(?)
SuffixAnySeqCRangeIter 37851 37801 -0.1% 1.00x
ByteSwap 8 8 +0.0% 1.00x
ObserverClosure 6268 6243 -0.4% 1.00x(?)
CharacterLiteralsSmall 917 917 +0.0% 1.00x
LazilyFilteredRange 1152275 1149922 -0.2% 1.00x
ArrayPlusEqualSingleElementCollection 251408 252575 +0.5% 1.00x(?)
ExistentialTestOneMethodCall_IntValueBuffer1 37179 37190 +0.0% 1.00x(?)
ExistentialTestOneMethodCall_IntValueBuffer2 38609 38604 -0.0% 1.00x(?)
ExistentialTestOneMethodCall_IntValueBuffer4 42322 42318 -0.0% 1.00x(?)
DropLastAnyCollection 5899 5917 +0.3% 1.00x(?)
ArrayAppendLatin1 99328 99331 +0.0% 1.00x(?)
CharacterLiteralsLarge 13451 13435 -0.1% 1.00x(?)
ObserverUnappliedMethod 7925 7942 +0.2% 1.00x(?)
ArrayPlusEqualArrayOfInt 617 616 -0.2% 1.00x
PopFrontArrayGeneric 7886 7921 +0.4% 1.00x(?)
ExistentialTestMutating_IntValueBuffer3 219003 219413 +0.2% 1.00x(?)
ExistentialTestMutating_IntValueBuffer2 153195 153061 -0.1% 1.00x
ExistentialTestMutating_IntValueBuffer1 92686 92439 -0.3% 1.00x(?)
CStringLongAscii 16210 16242 +0.2% 1.00x(?)
ExistentialTestMutating_IntValueBuffer4 305873 305836 -0.0% 1.00x(?)
Calculator 847 847 +0.0% 1.00x
ArrayOfGenericPOD 2902 2900 -0.1% 1.00x(?)
ArrayInClass 4295 4294 -0.0% 1.00x(?)
Phonebook 20101 20082 -0.1% 1.00x(?)
ExistentialTestTwoMethodCalls_IntValueBuffer2 76458 76470 +0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_IntValueBuffer3 85769 85730 -0.1% 1.00x(?)
ExistentialTestTwoMethodCalls_IntValueBuffer1 65929 65926 -0.0% 1.00x(?)
ExistentialTestArrayMutating_IntValueBuffer4 124359 124377 +0.0% 1.00x(?)
ExistentialTestArrayMutating_IntValueBuffer3 111453 111491 +0.0% 1.00x(?)
ExistentialTestArrayMutating_IntValueBuffer2 104791 104785 -0.0% 1.00x(?)
ExistentialTestArrayMutating_IntValueBuffer1 99798 99799 +0.0% 1.00x(?)
ExistentialTestArrayMutating_IntValueBuffer0 95271 95291 +0.0% 1.00x(?)
ArrayAppend 3588 3571 -0.5% 1.00x
RGBHistogram 30188 30269 +0.3% 1.00x(?)
TwoSum 3832 3845 +0.3% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer4 880254 878770 -0.2% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer3 1188996 1189169 +0.0% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer2 896243 896149 -0.0% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_ClassValueBuffer1 614414 613150 -0.2% 1.00x
CStringLongNonAscii 4200 4203 +0.1% 1.00x(?)
ArrayLiteral 1400 1398 -0.1% 1.00x
DropLastCountableRange 111 111 +0.0% 1.00x
ExistentialTestTwoMethodCalls_IntValueBuffer4 102922 102911 -0.0% 1.00x(?)
PrefixWhileAnySeqCRangeIter 37664 37654 -0.0% 1.00x(?)
RecursiveOwnedParameter 8851 8870 +0.2% 1.00x
ExistentialTestArrayShift_IntValueBuffer4 166444 166419 -0.0% 1.00x(?)
ExistentialTestArrayShift_IntValueBuffer3 169505 169937 +0.2% 1.00x(?)
ExistentialTestArrayShift_IntValueBuffer2 168083 168187 +0.1% 1.00x(?)
ExistentialTestArrayShift_IntValueBuffer1 169074 169096 +0.0% 1.00x(?)
ExistentialTestArrayShift_IntValueBuffer0 167567 167668 +0.1% 1.00x(?)
SuffixAnyCollection 5915 5925 +0.2% 1.00x(?)
DictionaryBridge 2471 2483 +0.5% 1.00x(?)
StringWithCString 325924 325952 +0.0% 1.00x(?)
Prims 8350 8333 -0.2% 1.00x
DropFirstCountableRange 319 319 +0.0% 1.00x
ArrayAppendToFromGeneric 619 619 +0.0% 1.00x
PopFrontArray 8787 8771 -0.2% 1.00x(?)
ArrayAppendGenericStructs 1195 1193 -0.2% 1.00x(?)
ProtocolDispatch 6545 6553 +0.1% 1.00x(?)
DropFirstAnySeqCRangeIter 27335 27343 +0.0% 1.00x(?)
StringEdits 813898 816561 +0.3% 1.00x(?)
Dictionary3 1339 1344 +0.4% 1.00x(?)
Dictionary2 3613 3612 -0.0% 1.00x(?)
StrComplexWalk 5646 5637 -0.2% 1.00x(?)
ExistentialTestArrayMutating_ClassValueBuffer2 115522 115525 +0.0% 1.00x(?)
ExistentialTestArrayMutating_ClassValueBuffer3 115558 115586 +0.0% 1.00x(?)
ExistentialTestArrayMutating_ClassValueBuffer1 115536 115596 +0.1% 1.00x(?)
ExistentialTestArrayMutating_ClassValueBuffer4 117375 117333 -0.0% 1.00x(?)
ArrayAppendOptionals 1194 1196 +0.2% 1.00x(?)
DropLastArray 1954 1954 +0.0% 1.00x
StringEqualPointerComparison 9019 9046 +0.3% 1.00x
StringAdder 39 39 +0.0% 1.00x
MapReduce 34402 34435 +0.1% 1.00x(?)
PrefixArrayLazy 26018 25895 -0.5% 1.00x(?)
Hanoi 15736 15731 -0.0% 1.00x(?)
DictionaryRemoveOfObjects 50636 50488 -0.3% 1.00x(?)
PrefixWhileAnySeqCntRange 33083 33184 +0.3% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer1 1248617 1248098 -0.0% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer3 2083950 2082805 -0.1% 1.00x
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer2 1658533 1651726 -0.4% 1.00x(?)
LazilyFilteredArrays 2545815 2550694 +0.2% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_ClassValueBuffer4 1799488 1801270 +0.1% 1.00x
DropWhileAnySeqCntRangeLazy 24838 24805 -0.1% 1.00x(?)
ExistentialTestTwoMethodCalls_ClassValueBuffer3 811564 810730 -0.1% 1.00x(?)
ExistentialTestTwoMethodCalls_ClassValueBuffer2 668444 668432 -0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_ClassValueBuffer1 523455 523508 +0.0% 1.00x(?)
ExistentialTestTwoMethodCalls_ClassValueBuffer4 816664 816510 -0.0% 1.00x(?)
ExistentialTestArrayOneMethodCall_ClassValueBuffer4 166211 166396 +0.1% 1.00x(?)
ExistentialTestArrayOneMethodCall_ClassValueBuffer1 149670 150120 +0.3% 1.00x(?)
ExistentialTestArrayOneMethodCall_ClassValueBuffer3 186889 186860 -0.0% 1.00x(?)
ExistentialTestArrayOneMethodCall_ClassValueBuffer2 168256 168334 +0.1% 1.00x(?)
ExistentialTestMutatingAndNonMutating_ClassValueBuffer1 475860 475927 +0.0% 1.00x(?)
LinkedList 31282 31238 -0.1% 1.00x(?)
MapReduceAnyCollection 34476 34330 -0.4% 1.00x
DropLastArrayLazy 8685 8704 +0.2% 1.00x(?)
ArrayOfPOD 1784 1783 -0.1% 1.00x(?)
Chars 7494 7502 +0.1% 1.00x(?)
DropWhileSequence 14172 14190 +0.1% 1.00x(?)
AnyHashableWithAClass 80573 80575 +0.0% 1.00x(?)
RC4 6803 6802 -0.0% 1.00x(?)
ArrayValueProp4 3147 3146 -0.0% 1.00x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer4 238729 238715 -0.0% 1.00x(?)
ArrayValueProp2 3426 3424 -0.1% 1.00x(?)
ArrayValueProp3 3220 3219 -0.0% 1.00x(?)
DropLastSequence 25980 25964 -0.1% 1.00x
ObjectiveCBridgeToNSString 1237 1240 +0.2% 1.00x(?)
PrefixWhileAnySequenceLazy 10467 10466 -0.0% 1.00x(?)
StringBuilderLong 1055 1053 -0.2% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer4 224824 224813 -0.0% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer3 246654 247430 +0.3% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer2 217915 218058 +0.1% 1.00x(?)
ExistentialTestArrayTwoMethodCalls_ClassValueBuffer1 190235 190898 +0.3% 1.00x(?)
PrefixAnySeqCRangeIter 21988 22039 +0.2% 1.00x(?)
PrefixWhileAnyCollection 33235 33151 -0.2% 1.00x
ExistentialTestArrayOneMethodCall_IntValueBuffer4 125543 125418 -0.1% 1.00x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer0 120188 120465 +0.2% 1.00x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer1 120913 120855 -0.1% 1.00x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer2 121184 121212 +0.0% 1.00x(?)
ExistentialTestArrayOneMethodCall_IntValueBuffer3 121674 121646 -0.0% 1.00x
DropWhileAnySequenceLazy 11429 11431 +0.0% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer4 298051 298118 +0.0% 1.00x(?)
DropWhileAnyCollection 22748 22651 -0.4% 1.00x(?)
ExistentialTestMutatingAndNonMutating_ClassValueBuffer4 636237 637591 +0.2% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer0 271906 271993 +0.0% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer1 273522 273824 +0.1% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer2 272536 272474 -0.0% 1.00x(?)
XorLoop 21509 21508 -0.0% 1.00x(?)
DropFirstSequenceLazy 11922 11896 -0.2% 1.00x
PrefixArray 5844 5845 +0.0% 1.00x(?)
ArrayAppendStrings 12872 12822 -0.4% 1.00x(?)
ExistentialTestArrayConditionalShift_IntValueBuffer3 273455 273458 +0.0% 1.00x(?)
ObjectAllocation 599 602 +0.5% 1.00x
SortSortedStrings 1329 1329 +0.0% 1.00x
ProtocolDispatch2 461 461 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 486 486 +0.0% 1.00x
ExistentialTestMutatingAndNonMutating_IntValueBuffer4 392711 392764 +0.0% 1.00x(?)
ArrayAppendFromGeneric 621 621 +0.0% 1.00x
ExistentialTestMutatingAndNonMutating_IntValueBuffer0 81194 81255 +0.1% 1.00x(?)
ArrayAppendUTF16 98696 98734 +0.0% 1.00x(?)
DropWhileAnyCollectionLazy 24739 24687 -0.2% 1.00x
ExistentialTestArrayShift_ClassValueBuffer4 166470 166452 -0.0% 1.00x(?)
ExistentialTestArrayShift_ClassValueBuffer2 168069 168106 +0.0% 1.00x(?)
ExistentialTestArrayShift_ClassValueBuffer3 169801 169688 -0.1% 1.00x(?)
ExistentialTestArrayShift_ClassValueBuffer1 169106 169111 +0.0% 1.00x(?)
SuffixAnySeqCRangeIterLazy 38097 37986 -0.3% 1.00x
DropWhileAnySeqCRangeIter 29331 29249 -0.3% 1.00x
Sim2DArray 27951 27946 -0.0% 1.00x(?)
StringHasSuffixUnicode 59031 59283 +0.4% 1.00x
SuffixAnyCollectionLazy 29257 29225 -0.1% 1.00x(?)
NSStringConversion 1225 1225 +0.0% 1.00x
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer3 223033 222787 -0.1% 1.00x
ArrayAppendArrayOfInt 617 616 -0.2% 1.00x
PolymorphicCalls 744 743 -0.1% 1.00x
DropLastAnySequenceLazy 26388 26397 +0.0% 1.00x(?)
DropWhileArray 9187 9224 +0.4% 1.00x
SuffixArray 1954 1955 +0.1% 1.00x(?)
PrefixWhileAnySeqCntRangeLazy 20575 20619 +0.2% 1.00x(?)
Memset 42192 42205 +0.0% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer0 183306 182434 -0.5% 1.00x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer2 206313 206697 +0.2% 1.00x
Dictionary2OfObjects 5788 5793 +0.1% 1.00x(?)
ArrayAppendReserved 3345 3347 +0.1% 1.00x(?)
ObjectiveCBridgeStubDateAccess 983 980 -0.3% 1.00x
SevenBoom 1523 1523 +0.0% 1.00x
DropFirstCountableRangeLazy 28472 28860 +1.4% 0.99x
SortLettersInPlace 2603 2619 +0.6% 0.99x
PrefixWhileAnyCollectionLazy 20498 20636 +0.7% 0.99x(?)
ObjectiveCBridgeStubFromNSString 922 928 +0.7% 0.99x(?)
PrefixAnySequenceLazy 10917 10975 +0.5% 0.99x(?)
ExistentialTestPassExistentialOneMethodCall_IntValueBuffer0 119939 121624 +1.4% 0.99x
SetIsSubsetOf 1539 1548 +0.6% 0.99x
NopDeinit 43805 44202 +0.9% 0.99x
PrefixWhileArrayLazy 13818 13947 +0.9% 0.99x
StringHasPrefixUnicode 15122 15238 +0.8% 0.99x
PrefixAnySeqCntRange 17657 17759 +0.6% 0.99x
ObjectiveCBridgeFromNSArrayAnyObjectToString 42091 42506 +1.0% 0.99x(?)
PrefixCountableRangeLazy 28469 28876 +1.4% 0.99x(?)
SuperChars 256690 259614 +1.1% 0.99x
DropLastAnySeqCntRange 5868 5915 +0.8% 0.99x
StringInterpolation 13705 13800 +0.7% 0.99x(?)
DropLastAnySeqCntRangeLazy 5805 5858 +0.9% 0.99x
ExistentialTestOneMethodCall_IntValueBuffer0 38917 39443 +1.4% 0.99x(?)
ObjectiveCBridgeToNSArray 27582 27970 +1.4% 0.99x(?)
Dictionary 1702 1721 +1.1% 0.99x
SetExclusiveOr 19653 19852 +1.0% 0.99x
ExistentialTestTwoMethodCalls_IntValueBuffer0 67696 68263 +0.8% 0.99x(?)
DictionaryRemove 18981 19220 +1.3% 0.99x
ObjectiveCBridgeStubFromArrayOfNSString 29635 29847 +0.7% 0.99x(?)
PrefixAnyCollectionLazy 86650 87291 +0.7% 0.99x
ObjectiveCBridgeStubFromNSStringRef 196 197 +0.5% 0.99x
SuffixCountableRangeLazy 9492 9595 +1.1% 0.99x(?)
DropFirstSequence 11974 12139 +1.4% 0.99x
DictionaryLiteral 12401 12477 +0.6% 0.99x
SuffixAnySeqCntRangeLazy 5806 5862 +1.0% 0.99x
StringMatch 81219 81847 +0.8% 0.99x(?)
DropFirstAnyCollectionLazy 87409 88710 +1.5% 0.99x
DictionarySwapOfObjects 17746 17875 +0.7% 0.99x(?)
StackPromo 94924 96110 +1.2% 0.99x(?)
DropWhileAnySeqCRangeIterLazy 24671 24893 +0.9% 0.99x
MapReduceString 2118 2141 +1.1% 0.99x
PrefixAnySeqCntRangeLazy 17350 17517 +1.0% 0.99x
DropFirstAnySeqCntRangeLazy 17322 17476 +0.9% 0.99x
ObjectiveCBridgeFromNSSetAnyObject 62761 63455 +1.1% 0.99x(?)
PopFrontUnsafePointer 92666 93970 +1.4% 0.99x(?)
ObjectiveCBridgeStubToNSStringRef 142 143 +0.7% 0.99x(?)
DropLastCountableRangeLazy 9494 9568 +0.8% 0.99x(?)
HashTest 5667 5711 +0.8% 0.99x
ObjectiveCBridgeToNSSet 34842 35283 +1.3% 0.99x(?)
DropFirstAnySeqCntRange 17612 17751 +0.8% 0.99x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer4 363934 366352 +0.7% 0.99x(?)
ExistentialTestPassExistentialTwoMethodCalls_IntValueBuffer1 175137 176080 +0.5% 0.99x(?)
ObjectiveCBridgeToNSDictionary 56501 57396 +1.6% 0.98x(?)
ObjectiveCBridgeStubFromNSDate 3833 3902 +1.8% 0.98x(?)
SortStringsUnicode 8464 8593 +1.5% 0.98x
ArrayPlusEqualFiveElementCollection 255178 261232 +2.4% 0.98x(?)
SetIntersect 10037 10222 +1.8% 0.98x
ObjectiveCBridgeFromNSStringForced 2600 2650 +1.9% 0.98x
PrefixWhileAnySeqCRangeIterLazy 20471 20813 +1.7% 0.98x
ObjectiveCBridgeFromNSArrayAnyObject 23607 24136 +2.2% 0.98x(?)
ObjectiveCBridgeStubDataAppend 3529 3602 +2.1% 0.98x(?)
SetUnion 11078 11293 +1.9% 0.98x(?)
ObjectiveCBridgeStubNSDateMutationRef 14209 14465 +1.8% 0.98x(?)
ObjectiveCBridgeStubNSDataAppend 2495 2539 +1.8% 0.98x
DropLastAnyCollectionLazy 28967 29767 +2.8% 0.97x
StringHasPrefix 1461 1516 +3.8% 0.96x
RGBHistogramOfObjects 80843 84225 +4.2% 0.96x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 6883 7174 +4.2% 0.96x(?)
DictionarySwap 4803 4986 +3.8% 0.96x
MapReduceShortString 220 228 +3.6% 0.96x
DropLastAnySeqCRangeIter 39206 40835 +4.2% 0.96x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 70850 73504 +3.8% 0.96x(?)
ObjectiveCBridgeStubURLAppendPathRef 208247 218398 +4.9% 0.95x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 95108 99697 +4.8% 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

@palimondo
Copy link
Contributor Author

I’m not done here yet, still working on SR-4600 and SR-4601, but I have requested the review for the changes do far - mainly the fix for Benchmark_Driver to correctly report MEAN and SD.

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

Some quick comments. I don't completely understand what you are trying to do with the 2nd patch and I have not read the first. I am going to look at this again later.

Copy link
Contributor

Choose a reason for hiding this comment

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

So just to make sure I am understanding this correctly, you are instrumenting the max resident size of the process tree rooted at the Driver given a specific test.

I think that will give you the max, but it won't allow you to calculate other statistics over the samples. I haven't thought about the implications of this... @lplarson your thoughts on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, as I understand this, this just gets the max memory used by the given test. This will not be a statistical sample, just a single value. All other stats: MIN, MAX, MEAN, SD, MEDIAN are correctly reported by Benchmark_O & co. and were — before this patch — dirscarded or corrupted by this script.

Copy link
Contributor

Choose a reason for hiding this comment

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

We want to be able to take an average of the peak memory usages.

Copy link
Contributor Author

@palimondo palimondo Apr 17, 2017

Choose a reason for hiding this comment

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

We first need to get the basics working at all. The script as is, does not report average memory use at all, but a sum of memory used in all runs — results depend on num-iterations. The MAX_RSS is not being reported by the compare_perf_tests.py either.

I have compared two runs (num-iterations 3 and 20) with the fixed script on my machine and the difference in MAX_RSS between the runs for all tests is in 0-1% range, with the exception of following:

Testname Mem Diff
Array2D 2 %
ArrayAppendSequence 2 %
ArrayAppend 3%
ArrayAppendStrings 4 %
ArrayPlusEqualSingleElementCollection 2 %
ArraySubscript 9 %
DictionaryBridge 90 %
MonteCarloE 3 %
ObjectiveCBridgeStubFromNSStringRef 9 %
ObjectiveCBridgeStubToNSStringRef 7 %
ObjectiveCBridgeToNSDictionary 84 %
ObjectiveCBridgeToNSSet 84 %
ObserverClosure 2 %
ObserverPartiallyAppliedMethod 3 %

It looks like there are some issues (leaks ?) with ObjC Bridging (DictionaryBridge, ObjectiveCBridgeToNSDictionary, ObjectiveCBridgeToNSSet). Let me emphasize that I was comparing run with 3 vs 20 samples, done by Benchmark_O. I’ll bet that comparing same number of iterations will yield 0-1% difference for all test.

I don’t see what could be gained by computing average memory used over multiple runs executed by Benchmark_Driver — are we really expecting Swift to have varying memory consumption between runs?!? That approach resulted in the need to redo all the statistics Benchmark_O already does in Benchmark_Driver- none of which was implemented correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lplarson @gottesmm Can I please get a response to the argument made in the above comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

Averaging is useful here for the same reason it's useful in measuring benchmark runtime. These systems always have noise and averaging helps deal with it. We moved to using Benchmark_Driver specifically for the reason of averaging over memory usage.

Copy link
Contributor

Choose a reason for hiding this comment

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

"The script as is, does not report average memory use at all, but a sum of memory used in all runs" Where do you see this?

Copy link
Contributor Author

@palimondo palimondo Apr 20, 2017

Choose a reason for hiding this comment

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

Re: "script doesn’t report average but sum” - I cannot reproduce what I saw. It definitely wasn’t caused by this script, but I have a few logs where the MAX_RSS dropped from about 10 MB (for small tests) to 3,3 MB. This lead me to believe the change was caused by my modification of the script (I was testing with num-iterations=3). Now the runs are back to 10 MB. I have no idea what is happening here, will investigate further. (One more reason to keep a better history - SR-4591).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’m taking this conversation to the top, being hidden under comments to outdated file is not helping.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use a string format rather than str? i.e.: '--num-samples={}'.format(num_samples) or using '%s'

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use early returns here to eliminate the elif. You do not have any code of consequence after the condition. This is communicated to the reader of the code in a more succint way by using early returns. i.e.:

if args.filter:
    prefix = args.filter
    return filter(lambda name: name.startswith(prefix), tests)

if not args.benchmark:
    return tests

benchmarks = set(args.benchmark)
return sorted(list(set(tests).intersection(benchmarks)))

Notice how just by reading the code the reader is able to know the amount of work left to be returned without having to read the whole function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Using --num-samples and getting the peak memory usage of a single invocation doesn't allow us to average the memory usage for each sample.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to be able to average over peak memory usages.

@palimondo
Copy link
Contributor Author

I have a question about output from compute_perf_test.py: currently it writes output to file specified in --output argument in the format specified in --format argument, but always writes to stdout! Either markdown (for markdown or no specified format) or git format (for html or git).

I propose that it always writes only in specified format and that it writes either to stdout OR the file, when --output is specified.

@palimondo
Copy link
Contributor Author

Can I please get a guidance about the script outputs I suggest altering in the above comment?
I’d like to change compare_perf_test.py to behave like standard common line utility. At the moment it does two outputs simultaneously: tostdout in one format, to output file - if specified - in another format. Is that a desired behavior that something else depends on?
@lplarson @gottesmm @shahmishal

@palimondo
Copy link
Contributor Author

OMG, I need help from git expert - I messed something up here. I wasn’t able to push my recent commits. It said I needed to git pull first, I played with git rebase, reset, clean and co… and now I’ve somehow pulled in commit from @atrick about “CopyForwarding” and have one of mine duplicated. Agh. Help (e-mail, twitter)?

@lplarson
Copy link
Contributor

@palimondo Can you rebuild your branch and force push?

@palimondo
Copy link
Contributor Author

I’ll try to fix my branch and force push.

Here I’d like to continue our discussion from the hidden comments on outdated Benchmark_Driver.

@lplarson: Maybe you could explain more about the reasoning that lead to iterating in Benchmark_Driver?

When measuring runtime performance on multitasking system, we have to take into account the system’s weather: other processes competing for the CPU. We are taking multiple samples and trying to statistically approximate a “true” runtime. Instead of measuring how would our benchmark perform if it was the only thing running — this is never the case — we settle for a consistently reproducible result. We should be discarding extreme values and work with the mean.

In case of measuring memory usage, the system's weather is much less severe. There certainly is variation due to interaction between allocator and OS that depends on the available memory, but this is small compared to measuring runtime. Other processes do not directly impact our own memory consumption.

We are measuring the memory usage by instrumenting the benchmark run with time -lp command that adds the following epilogue to the test run:

#,TEST,SAMPLES,MIN(us),MAX(us),MEAN(us),SD(us),MEDIAN(us)
1,AngryPhonebook,2,10799,12206,11502,994,12206

Totals,1,10799,12206,11502,0,0
real         2.09
user         1.93
sys          0.01
   3469312  maximum resident set size
         0  average shared memory size
         0  average unshared data size
         0  average unshared stack size
       905  page reclaims
         0  page faults
         0  swaps
         0  block input operations
         0  block output operations
         0  messages sent
         0  messages received
         0  signals received
         0  voluntary context switches
       514  involuntary context switches

From this we extract the Maximum resident set size. The granularity of this value is always a multiple of page size - 4098 on macOS. That is the smallest amount of memory the operating system deals with - the smaller allocations amounts used internally by the program are handled by the allocator (malloc) and that is part of the Swift runtime. In theory it is possible to measure memory usage on finer level by using a custom allocator to track all the details, but this is what we are discussing here.

When we look at the vast amount of tests in the Swift benchmark suite, as long as they are pure Swift, they are very stable memory wise. Running Benchmark_Driver run -o O -i 3 AngryPhonebook 4 times gives:

Benchmark_Driver iterates Samples MAX_RSS(B) Deviation CV
AngryPhonebook 3 10 519 893 -683 -0 %
AngryPhonebook 3 10 523 989 -4 779 -0 %
AngryPhonebook 3 10 517 163 2 048 0 %
AngryPhonebook 3 10 515 797 3 414 0 %
Average 10 519 211 3 612

Each MAX_RSS value is the mean of 3 samples taken by the current version of Benchmark_Driver. The last row is mean of the means from the 4 runs (i.e. average from 12 samples). Deviation column shows the difference between MAX_RSS and the Average RSS. The last value in Deviation column is the standard deviation (SD), CV is coefficient of variation defined as the ratio of the standard deviation to the mean.

Raising the sample size to 20 buys us very little:

Benchmark_Driver iterates Samples MAX_RSS(B) Deviation CV
AngryPhonebook 20 10 520 781 -1 434 -0 %
AngryPhonebook 20 10 514 637 4 710 0 %
AngryPhonebook 20 10 522 829 -3 482 -0 %
AngryPhonebook 20 10 519 142 205 0 %
Average 10 519 347 3 484 0 %

Notice how the variation between MAX_RSS values reported from different runs did not decrease even when we increased the sample size. This is because we are now doing statistical analysis of the noise that is below the precision of our measurement. The point to take home is that CV is hugging 0%.

If we ditched averaging of RSS and left the computation of other statistics to Benchmark_O and co. as I suggest in my patch, the result looks like this:

Benchmark_0
--num-samples
Samples MAX_RSS(B) Deviation CV #Pages Delta
AngryPhonebook 20 11 079 680 2 048 0 % 2 705 0
AngryPhonebook 20 11 079 680 2 048 0 % 2 705 0
AngryPhonebook 20 11 087 872 -6 144 -0 % 2 707 2
AngryPhonebook 20 11 079 680 2 048 0 % 2 705 0
Average 11 081 728 4 096 2 705

At first glance the SDlooks worse, but to clarify I’ve added 2 columns: the number of memory pages allocated (MAX_RSS / 4096) and the delta between the minimal number of pages (#Pages, last row) and the current one.

Notice the different sizes reported between the two versions of Benchmark_Driver — about 130 pages or 500 kB — they stay same even for --num-samples=1, so I guess this is all due to driver processing the --num-samples argument from command line.

My argument is that while the CV stays low, we are good to stake just one measurement and report memory regressions (not done currently at all) based on the % change between them, say above 5%.

This takes me to further analyze tests that had high CV — I’ve referred to that as Mem Diff in the table of suspicious test in my previous comment. I believe they are all a symptom of a bug: memory leaks in the bridging implementation. This is actually hidden by current, MAX_RSS averaging, implementation of BenchmarkDriver. When measured by my modified driver I see this:

Benchmark_0
--num-samples
S. MAX_RSS(B) Deviation CV #Pages Delta
DictionaryBridge 3 36 966 400 4 481 024 12 % 9 025 0 0 %
DictionaryBridge 3 42 110 976 -663 552 -2 % 10 281 1 256 12 %
DictionaryBridge 3 44 720 128 -3 272 704 -7 % 10 918 1 893 17 %
DictionaryBridge 3 41 992 192 -544 768 -1 % 10 252 1 227 12 %
Average 41 447 424 3 241 771 9 025
Benchmark_0
--num-samples
S. MAX_RSS(B) Deviation CV #Pages Delta
DictionaryBridge 20 179 634 176 33 456 128 19 % 43 856 0 0 %
DictionaryBridge 20 203 837 440 9 252 864 5 % 49 765 5 909 12 %
DictionaryBridge 20 235 429 888 -22 339 584 -9 % 57 478 13 622 24 %
DictionaryBridge 20 233 459 712 -20 369 408 -9 % 56 997 13 141 23 %
Average 213 090 304 26 576 291 43 856

Going from 3 to 20 samples increases memory consumption 5 times! Based on that I’m lumping ObjectiveCBridgeToNSDictionary and ObjectiveCBridgeToNSSet together as the same bug.

The other volatile test are much less severe (CV < 10%) and have in common intense use of Array. I’ve looked in detail at MonteCarloE. It performs a lot of random number computations, similar to MonteCarloPi, but in contrast to that it builds a huge [Bool].

Benchmark_0 --num-samples Samples Average MAX_RSS(B)
MonteCarloE 1 22 128 933
MonteCarloE 3 26 537 984
MonteCarloE 20 32 735 232

This looks like a much less severe, but still some kind of memory leak in the implementation of Array. Given that the ContinuousArray is recommended for use with pure Swift code, that doesn’t need to interoperate with ObjC, I’m guessing that Array always carries some kind of baggage for bridging support that could be similar to the above issues with Set and Dictionary bridging???

ObserverPartiallyAppliedMethod had a up to 5% CV with 3 iterations but stabilized to 0-1% with 20 iterations, the memory increase maybe worth investigating?

Benchmark_0 --num-samples Samples Average MAX_RSS(B)
ObserverPartiallyAppliedMethod 3 83 765 248
ObserverPartiallyAppliedMethod 20 86 861 824

All in all, I believe that unstable memory usage in benchmarks is a sign of bugs in underlying implementation - not a fact of nature that we need to deal with by averaging. This approach allowed for the above bugs to hide in plain sight for who-knows-how-long.

Or am I really misunderstanding some fundamental issue that lead you to compute average MAX_RSS in the Benchmark_Driver?

@palimondo palimondo force-pushed the compare-performance branch from 01e433a to f594745 Compare April 21, 2017 08:09
@palimondo
Copy link
Contributor Author

I have fixed my branch and force pushed.

@lplarson @shahmishal @gottesmm Can I get some answers here? I’d like to continue the work on this, but I’d hate to throw it away if you don’t like where I’d like to take it. See the 4-5 comments above.

@palimondo
Copy link
Contributor Author

FWIW, I’ve filed

  • SR-4666 Dictionary bridge is leaking memory
  • SR-4667 Array is probably leaking memory
  • SR-4668 NSStringRef is probably leaking memory
    to track the issue of the most memory unstable benchmarks.

@palimondo
Copy link
Contributor Author

palimondo commented Apr 22, 2017

Note about the current compare_perf_test.pyscript's always-present output to stdout:
when the --format is markdown, it outputs it; otherwise it prints out in PAIN_DETAIL format — that is markdown with "-" and "|" replaced by " " and omission of <detail><summary>. Is that a desired and necessary behavior? (If so, could we at least always output to console in the same format?)

@atrick
Copy link
Contributor

atrick commented Apr 22, 2017

No idea what you're actually proposing. The original motivation was to paste the output into a git message or copy paste some lines into emacs org mode and org-table-convert-region. I think the --output option is for integration with CI. I don't use it and don't really understand why it would be tied to the format.

I'd be fine with just a "markdown" format by default, as it is today, and "text" format that has the markup and table characters stripped away.

@atrick
Copy link
Contributor

atrick commented Apr 22, 2017

BTW: what we really need is a Benchmark_Driver --rerun=N feature: https://bugs.swift.org/browse/SR-4669

@palimondo
Copy link
Contributor Author

@atrick I'm proposing that the script always outputs in the format specified by --format attribute and that it either writes to stdout or to file if --output is specified.

@atrick
Copy link
Contributor

atrick commented Apr 22, 2017

@palimondo That sounds completely sane. Thanks. As long as it's ok with @shahmishal.

@gottesmm
Copy link
Contributor

@palimondo Can you group the commits into different PRs. I have time to review today in a little bit.

@palimondo palimondo force-pushed the compare-performance branch from 242d614 to 3c59bdf Compare April 24, 2017 19:19
@palimondo
Copy link
Contributor Author

@gottesmm I can, if you tell me what you want… Wrote you an e-mail.

@gottesmm
Copy link
Contributor

@palimondo I responded via email. Did I answer your question?

Also: use single quote strings
@lplarson
Copy link
Contributor

@palimondo Thinking about this more, I'm fine if we don't take the average MAXRSS from multiple runs as long as we maintain the same number of columns in the output. We can then monitor the results to see if we notice problems in action.

@palimondo
Copy link
Contributor Author

@lplarson In the discussion on SR-4667 @aschwaighofer explained where does the whole variance in memory usage between runs come from: Benchmark_O and co. are adaptive — they run different number of iterations (N) between runs — to get roughly 1s runtime for each test. Coupled with autorelease calling convention for ObjC object you end up with different amounts of garbage between runs. If you specify num-iterations they are memory stable (-+ few pages).

So I'm thinking we need to monitor memory usage separately, in a different run with fixed num-iterations?

@lplarson
Copy link
Contributor

If we can use a static number of iterations and get reliable results, then I'm all for it. We can potentially speed up benchmarking by not running each test for a second as well.

@aschwaighofer, @gottesmm Am I missing a profound reason to adaptively find iteration counts that run for 1 second apart from convenience to the person adding a test? If it's only convenience, it seems easy enough to create a utility that will find the proper iteration count and set it statically in the test before committing. This would cut down on some noise in the benchmarks.

@aschwaighofer
Copy link
Contributor

@lplarson I am not the author. I see no profound reason. We will need different counts for O and Onone. Also, it will vary on platforms. But presumably not by a significant factor so if you aim for 0.1 s you will probably be fine on slower platforms.

@atrick
Copy link
Contributor

atrick commented Apr 27, 2017

@lplarson @aschwaighofer @gottesmm The driver should first determine how many iterations are necessary for a sufficient sample period. 1s is seen as long enough to factor out the timing and harness overhead. The number of iterations varies wildly between revisions of the compiler. It's critically important that a badly behaving benchmark doesn't sabotage a set of runs by taking minutes to complete, and it's important that benchmarks remain measurable after they are dramatically improved. I've never heard of this technique as introducing noise. It's supposed to reduce noise. At any rate, the driver became much more useful after Michael Z (Mr. zperf) implemented this.

@atrick
Copy link
Contributor

atrick commented Apr 27, 2017

@lplarson @palimondo Oh, I see where this fixed iteration question came from. Measure memory utilization and cpu cycles is a totally different thing. I think it should be a separate run with a separate report.

@atrick
Copy link
Contributor

atrick commented Apr 27, 2017

One more thing :) I really don't want my benchmark runs to be slowed down by measuring memory usage. It's a great thing to track and helpful to reveal leaks, but not something I want to look at 99% of the time.

@palimondo
Copy link
Contributor Author

That was my point. We should kick the MAX_RSS measurement out of the timing measurement and do a separate pass for memory only. Then we don’t need to re-implement whole averaging in Benchmark_Driveragain.

I think this would be better doable in a separate log file even. I suggest following:

  • To get the first baseline: do a single Benchmark_O sample run, with verbose setting - extract the computed N (Measuring with scale ###) for each test (that’s the part that ensures ~1s runtime - makes sense to maintain it)
  • If baseline exists (i.e. comparing against old memory log file), get Ns for test from there
  • Run each test instrumented to extract MAX_RSS with proper fixed N
    This is all with --num-samples=1, this should take about 5 minutes on my machine.
  • Log test name, num-iterations, MAX_RSS
  • ????
  • PROFIT!!!

This frees Benchmark_Driver to completely rely on Benchmark_O for normal performance run. It even supports filtering by index number, so we can pass all this in single invocation. Currently the Benchmark_Driver does numberOfTests * iterations separate invocations of Benchmark_O.

Do I have a green light to implement this?

@atrick
Copy link
Contributor

atrick commented Apr 27, 2017

@palimondo That sounds great. The technique of parsing the scale from the first (zero-sample) run and reusing it for subsequent runs will also be needed for measuring CPU time across multiple invocations of Benchmark_O (see --rerun feature). In the future we'll even want to do that across multiple builds of Benchmark_O that we want to compare.

@lplarson
Copy link
Contributor

Sounds good to me.

@lplarson
Copy link
Contributor

Please work with @shahmishal to make sure benchmark pull request testing isn't disrupted.

@palimondo
Copy link
Contributor Author

@lplarson Re: Work with @shahmishal. What do you mean, exactly?

@palimondo
Copy link
Contributor Author

Wow… 😲

$ $BUILD/bin/Benchmark_O --verbose --num-samples=5 99
Verbose
--- CONFIG ---
NumSamples: 5
Verbose: true
IterScale: 1
Tests Filter: ["99"]
Tests to run: DropWhileSequenceLazy, 

--- DATA ---
#,TEST,SAMPLES,MIN(us),MAX(us),MEAN(us),SD(us),MEDIAN(us)
Running DropWhileSequenceLazy for 5 samples.
    Measuring with scale 840.
    Sample 0,304
    Measuring with scale 3601.
    Sample 1,290
    Measuring with scale 2198.
    Sample 2,301
    Measuring with scale 2832.
    Sample 3,298
    Measuring with scale 3596.
    Sample 4,298
99,DropWhileSequenceLazy,5,290,304,298,5,298

Totals,1,290,304,298,0,0

Scale (num-iters) varies between samples? How are these then comparable?!?

@palimondo
Copy link
Contributor Author

palimondo commented Apr 27, 2017

I’d argue that the scale computation in DriverUtils, runBench should be before the for s in 0..<c.numSamples.

@palimondo
Copy link
Contributor Author

Re: How are these comparable… samples[s] = elapsed_time / UInt64(scale) / 1000 💡 🤸‍♂️

@lplarson
Copy link
Contributor

@palimondo Let @shahmishal know if you need to change something that will break "@SwiftCI please benchmark"

@palimondo
Copy link
Contributor Author

@shahmishal @lplarson Where can I see how the "@SwiftCI please benchmark” works? Is the GitHub integration visible somewhere? I’d love to know how the CI works in more detail, in order to fix SR-4675 Report detailed build version from Benchmark drivers.

In the final stage, I want to see in the report the unique identification of the branch and commit of the two compared versions. These also need to be in the logs from Benchmark_Driver. The baby step landed in #8978 Fix SR-4659 Benchmark logs should be tied to tested tree version, but that depends on the state of working directory at the time of benchmark. This works fine for CI, but is not good enough for local development — ergo SR-4675.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants