Skip to content

[Runtime] Use a #define for the value of swift_isaMask. #24616

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 1 commit into from
May 10, 2019

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented May 8, 2019

This allows _swift_getClassOfAllocated to use a constant instead of loading from a global, and allows swift_isaMask to be computed without a static initializer. Debug builds verify that the #define matches the value from libobjc.

rdar://problem/22375602 rdar://problem/46385113

@mikeash mikeash requested a review from Catfish-Man May 8, 2019 19:13
@mikeash
Copy link
Contributor Author

mikeash commented May 8, 2019

@swift-ci please test

Copy link
Contributor

@Catfish-Man Catfish-Man left a comment

Choose a reason for hiding this comment

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

Looks great!

@Catfish-Man
Copy link
Contributor

@swift-ci please smoke benchmark

@swift-ci
Copy link
Contributor

swift-ci commented May 8, 2019

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
EqualStringSubstring 38 43 +13.2% 0.88x (?)
LessSubstringSubstring 39 44 +12.8% 0.89x
EqualSubstringSubstring 38 42 +10.5% 0.90x (?)
EqualSubstringSubstringGenericEquatable 38 42 +10.5% 0.90x
EqualSubstringString 39 43 +10.3% 0.91x (?)
LessSubstringSubstringGenericComparable 39 43 +10.3% 0.91x
Improvement
StringToDataMedium 3600 3300 -8.3% 1.09x (?)
FlattenListLoop 4336 3978 -8.3% 1.09x
RemoveWhereMoveInts 37 34 -8.1% 1.09x (?)
Array2D 7520 6912 -8.1% 1.09x (?)
RemoveWhereSwapInts 65 60 -7.7% 1.08x (?)
MapReduce 397 368 -7.3% 1.08x (?)
MapReduceAnyCollection 397 369 -7.1% 1.08x
FlattenListFlatMap 6529 6079 -6.9% 1.07x (?)

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
LessSubstringSubstring 39 44 +12.8% 0.89x
EqualSubstringString 39 44 +12.8% 0.89x (?)
LessSubstringSubstringGenericComparable 39 44 +12.8% 0.89x
EqualSubstringSubstring 39 43 +10.3% 0.91x (?)
EqualStringSubstring 39 43 +10.3% 0.91x
EqualSubstringSubstringGenericEquatable 39 43 +10.3% 0.91x (?)
Improvement
FlattenListLoop 4433 4070 -8.2% 1.09x (?)
RemoveWhereMoveInts 37 34 -8.1% 1.09x (?)
Array2D 7520 6912 -8.1% 1.09x (?)
RemoveWhereSwapInts 67 62 -7.5% 1.08x (?)
MapReduce 433 404 -6.7% 1.07x (?)

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
ArrayOfGenericPOD2 1065 1179 +10.7% 0.90x (?)
ArrayOfPOD 779 853 +9.5% 0.91x (?)
Improvement
ExclusivityIndependent 84 74 -11.9% 1.14x (?)
ObjectiveCBridgeStubFromNSDateRef 5080 4510 -11.2% 1.13x (?)
CharacterLiteralsLarge 608 568 -6.6% 1.07x (?)
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

@Catfish-Man
Copy link
Contributor

Those substring tests have been really inconclusive and noisy lately, I wonder if that's fixable

@swift-ci
Copy link
Contributor

swift-ci commented May 8, 2019

Build failed
Swift Test OS X Platform
Git Sha - 6ffec666ffde0cffbe11ae6284aed9e49bcba742

@mikeash mikeash force-pushed the hardcode-swift-isamask branch from 6ffec66 to cededf6 Compare May 9, 2019 18:11
@mikeash
Copy link
Contributor Author

mikeash commented May 9, 2019

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented May 9, 2019

Build failed
Swift Test Linux Platform
Git Sha - 6ffec666ffde0cffbe11ae6284aed9e49bcba742

@swift-ci
Copy link
Contributor

swift-ci commented May 9, 2019

Build failed
Swift Test OS X Platform
Git Sha - 6ffec666ffde0cffbe11ae6284aed9e49bcba742

This allows _swift_getClassOfAllocated to use a constant instead of loading from a global, and allows swift_isaMask to be computed without a static initializer. Debug builds verify that the #define matches the value from libobjc.

rdar://problem/22375602 rdar://problem/46385113
@mikeash mikeash force-pushed the hardcode-swift-isamask branch from cededf6 to b85c600 Compare May 10, 2019 13:38
@mikeash
Copy link
Contributor Author

mikeash commented May 10, 2019

@swift-ci please smoke test

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.

3 participants