Skip to content

[DNM] disable assign/partial store as a test. #21918

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

Conversation

gottesmm
Copy link
Contributor

Just a test.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
SuffixAnySequence 564 2078 +268.4% 0.27x
BinaryFloatingPointPropertiesBinade 25 31 +24.0% 0.81x
Improvement
SuffixSequence 563 447 -20.6% 1.26x
SuffixSequenceLazy 563 447 -20.6% 1.26x
DictionaryGroup 245 227 -7.3% 1.08x
DictionaryCopy 53393 49564 -7.2% 1.08x (?)
MapReduce 396 368 -7.1% 1.08x
LessSubstringSubstring 43 40 -7.0% 1.07x (?)
EqualStringSubstring 43 40 -7.0% 1.07x (?)
EqualSubstringSubstringGenericEquatable 43 40 -7.0% 1.07x
EqualSubstringString 43 40 -7.0% 1.07x (?)
LessSubstringSubstringGenericComparable 43 40 -7.0% 1.07x (?)

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
DictionaryCopy.o 7885 8669 +9.9% 0.91x
DictionaryCompactMapValues.o 19158 20854 +8.9% 0.92x
DictTest2.o 14491 15339 +5.9% 0.94x
DictionaryRemove.o 14453 15253 +5.5% 0.95x
DictTest.o 19734 20582 +4.3% 0.96x
Suffix.o 25841 26921 +4.2% 0.96x
DictTest3.o 21947 22795 +3.9% 0.96x
DictionarySwap.o 21713 22497 +3.6% 0.97x
RGBHistogram.o 26998 27726 +2.7% 0.97x
DictionarySubscriptDefault.o 28057 28801 +2.7% 0.97x
StringInterpolation.o 7299 7467 +2.3% 0.98x
ExistentialPerformance.o 68355 69427 +1.6% 0.98x
MapReduce.o 32723 33155 +1.3% 0.99x
BinaryFloatingPointProperties.o 7612 7702 +1.2% 0.99x
Improvement
ArrayOfGenericRef.o 15004 14068 -6.2% 1.07x
ClassArrayGetter.o 5639 5447 -3.4% 1.04x
Join.o 2288 2216 -3.1% 1.03x
DictionaryGroup.o 18251 17803 -2.5% 1.03x
RangeAssignment.o 4892 4772 -2.5% 1.03x
ArrayAppend.o 39176 38240 -2.4% 1.02x
ObserverClosure.o 3279 3207 -2.2% 1.02x
MonteCarloE.o 3396 3324 -2.1% 1.02x
Hanoi.o 3537 3465 -2.0% 1.02x
ObserverPartiallyAppliedMethod.o 3567 3495 -2.0% 1.02x
Breadcrumbs.o 46452 45516 -2.0% 1.02x
ObserverForwarderStruct.o 3690 3618 -2.0% 1.02x
ArraySubscript.o 3892 3820 -1.8% 1.02x
ReversedCollections.o 11307 11123 -1.6% 1.02x
Combos.o 7457 7337 -1.6% 1.02x
Queue.o 14203 13987 -1.5% 1.02x
ArrayOfRef.o 12258 12074 -1.5% 1.02x
ObjectiveCBridgingStubs.o 23204 22868 -1.4% 1.01x
ObserverUnappliedMethod.o 5298 5226 -1.4% 1.01x
PopFrontGeneric.o 4734 4670 -1.4% 1.01x
PopFront.o 5213 5149 -1.2% 1.01x
Phonebook.o 11987 11841 -1.2% 1.01x
RangeReplaceableCollectionPlusDefault.o 6317 6245 -1.1% 1.01x
StringEdits.o 11935 11799 -1.1% 1.01x
Array2D.o 4303 4255 -1.1% 1.01x
RemoveWhere.o 24119 23855 -1.1% 1.01x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
SuffixAnySequence 945 2402 +154.2% 0.39x
Data.hash.Empty 68 77 +13.2% 0.88x (?)
SuffixCountableRangeLazy 11 12 +9.1% 0.92x
DictionaryCopy 72307 78569 +8.7% 0.92x (?)
Improvement
MapReduceLazyCollectionShort 85 41 -51.8% 2.07x
DropWhileAnySeqCRangeIter 204 180 -11.8% 1.13x
DropWhileAnySeqCntRange 183 163 -10.9% 1.12x (?)
CharacterLiteralsLarge 111 100 -9.9% 1.11x
BinaryFloatingPointPropertiesBinade 31 28 -9.7% 1.11x (?)
StringComparison_latin1 770 712 -7.5% 1.08x
LessSubstringSubstring 43 40 -7.0% 1.07x (?)
CharacterLiteralsSmall 345 322 -6.7% 1.07x (?)

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
ArraySetElement.o 1309 1381 +5.5% 0.95x
DictionaryCompactMapValues.o 12566 13190 +5.0% 0.95x
COWArrayGuaranteedParameterOverhead.o 1467 1537 +4.8% 0.95x
Sim2DArray.o 1576 1648 +4.6% 0.96x
ArrayInClass.o 1982 2054 +3.6% 0.96x
Suffix.o 24649 25537 +3.6% 0.97x
XorLoop.o 2098 2170 +3.4% 0.97x
Memset.o 2130 2202 +3.4% 0.97x
SetTests.o 64967 66513 +2.4% 0.98x
Improvement
RangeAssignment.o 5018 4685 -6.6% 1.07x
PopFrontGeneric.o 4823 4503 -6.6% 1.07x
StringInterpolation.o 6929 6540 -5.6% 1.06x
FlattenList.o 6696 6344 -5.3% 1.06x
Array2D.o 4669 4451 -4.7% 1.05x
ArrayAppend.o 31940 30508 -4.5% 1.05x
SortIntPyramids.o 12777 12241 -4.2% 1.04x
PopFront.o 5086 4878 -4.1% 1.04x
RandomShuffle.o 3767 3655 -3.0% 1.03x
RemoveWhere.o 24062 23350 -3.0% 1.03x
ObjectiveCBridgingStubs.o 18508 17972 -2.9% 1.03x
Combos.o 7873 7649 -2.8% 1.03x
DictionaryGroup.o 14351 13943 -2.8% 1.03x
CSVParsing.o 30993 30121 -2.8% 1.03x
MonteCarloE.o 3778 3682 -2.5% 1.03x
Queue.o 13011 12699 -2.4% 1.02x
Phonebook.o 12388 12092 -2.4% 1.02x
ReversedCollections.o 9746 9514 -2.4% 1.02x
LazyFilter.o 8977 8769 -2.3% 1.02x
DictOfArraysToArrayOfDicts.o 26982 26387 -2.2% 1.02x
CString.o 8394 8210 -2.2% 1.02x
MapReduce.o 26547 26019 -2.0% 1.02x
ClassArrayGetter.o 5641 5529 -2.0% 1.02x
Breadcrumbs.o 45893 45005 -1.9% 1.02x
Walsh.o 5916 5804 -1.9% 1.02x
ReduceInto.o 9955 9771 -1.8% 1.02x
UTF8Decode.o 10878 10718 -1.5% 1.01x
SortLettersInPlace.o 9070 8942 -1.4% 1.01x
WordCount.o 39596 39052 -1.4% 1.01x
StringEdits.o 11830 11686 -1.2% 1.01x
DropLast.o 24371 24075 -1.2% 1.01x
DictionaryRemove.o 9725 9613 -1.2% 1.01x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
CharIteration_ascii_unicodeScalars_Backwards 369720 435400 +17.8% 0.85x (?)
CharIteration_chinese_unicodeScalars_Backwards 281080 328520 +16.9% 0.86x (?)
CharIteration_japanese_unicodeScalars_Backwards 446040 518560 +16.3% 0.86x (?)
ExclusivityIndependent 72 83 +15.3% 0.87x
CharIteration_utf16_unicodeScalars_Backwards 293040 328640 +12.1% 0.89x (?)
NSDictionaryCastToSwift 6345 6903 +8.8% 0.92x (?)
CharacterLiteralsLarge 591 637 +7.8% 0.93x (?)
Improvement
SortStringsUnicode 5284 4824 -8.7% 1.10x (?)
StackPromo 97061 88658 -8.7% 1.09x (?)
Histogram 8994 8277 -8.0% 1.09x (?)
CharIndexing_ascii_unicodeScalars 617960 575240 -6.9% 1.07x (?)

Code size: -swiftlibs

TEST OLD NEW DELTA RATIO
Improvement
libswiftSwiftPrivate.dylib 45056 40960 -9.1% 1.10x
libswiftSwiftOnoneSupport.dylib 163840 159744 -2.5% 1.03x
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB
--------------

@gottesmm gottesmm force-pushed the pr-75a803f814bbe0a7bd5b5533baf879c9e1c806b3 branch from 4c858de to 85ee34f Compare January 16, 2019 23:16
@gottesmm
Copy link
Contributor Author

@swift-ci smoke benchmark

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke benchmark

@gottesmm
Copy link
Contributor Author

@swift-ci smoke benchmark

@gottesmm
Copy link
Contributor Author

@swift-ci test

3 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4c858de7dbf376629b9d57523e03ba48e0bb193e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4c858de7dbf376629b9d57523e03ba48e0bb193e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4c858de7dbf376629b9d57523e03ba48e0bb193e

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
DataAppendDataLargeToLarge 38800 51600 +33.0% 0.75x (?)
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB
--------------

… stops

allocations from being removed.

PartialStore and Assign in PMO today both are allowed and do not prevent an
allocation from being removed. This is incorrect with ownership since in both
cases if we have a non-trivial type, we would need to make sure that the value
being overwritten is destroyed.

Clearly, with ownership given that we do not know how to handle assigns in the
aforementioned way, we can not remove allocation with ownership. When I make the
optimization more conservative by changing assigns to stop allocations from
being removed, I see no difference in the tests/benchmarks/etc. So it makes
sense to make the change now.

The reason to remove PartialStore is that:

1. It is actually a vestigal remnant of Definite Init code in Predictable Mem
Opts. If you look in Definite Init, understanding PartialStores is a very
important part of the algorithm for diagnosing partially initialized memory
locations. In Predictable Mem Opts it only controlled whether or not we could
eliminate an allocation.

2. PartialStore assumes that values are always initialized completely so a
partial store must be an assign. Despite that the two places it was used in the
code was a place where we assumed that SILGen was always going to always have an
init anyways (meaning we produced a partial store without need) or in a case
where if we do not have an init, we can just treat it like an assign (the
copy_addr) case.
@gottesmm gottesmm force-pushed the pr-75a803f814bbe0a7bd5b5533baf879c9e1c806b3 branch from 85ee34f to 99d86f5 Compare January 18, 2019 01:48
@gottesmm gottesmm changed the title disable assign/partial store as a test. [DNM] disable assign/partial store as a test. Jan 20, 2019
gottesmm added a commit to gottesmm/swift that referenced this pull request Jan 20, 2019
…ign of the dest rather than like a non-trivial type.

PMO uses InitOrAssign for trivially typed things and Init/Assign for non-trivial
things, so I think this was an oversight from a long time ago. There is actually
no /real/ effect on the code today since after exploding the copy_addr, the
store will still be used to produce the right available value and since for
stores, init/assign/initorassign all result in allocations being removed. Once
though I change assign to not allow for allocation removal (the proper way to
model this), without this change, certain trivial allocations will no longer be
removed, harming perf as seen via the benchmarking run on the bots in swiftlang#21918.
@gottesmm
Copy link
Contributor Author

Closing this. It served its purpose.

@gottesmm gottesmm closed this Jan 20, 2019
@gottesmm gottesmm deleted the pr-75a803f814bbe0a7bd5b5533baf879c9e1c806b3 branch January 20, 2019 19:53
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.

2 participants