Skip to content

[stdlib] Simplify __SwiftNativeNSArrayWithContiguousStorage.count #26125

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
Jul 14, 2019

Conversation

lorentey
Copy link
Member

There is what looks like unnecessary levels of indirection in the implementation of NSArray.count on the native Array storage class. Remove it.

@lorentey lorentey requested a review from Catfish-Man July 12, 2019 23:46
@lorentey
Copy link
Member Author

@swift-ci 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 immensely better!

@Catfish-Man
Copy link
Contributor

@swift-ci smoke benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListLoop 4709 5186 +10.1% 0.91x (?)
NSStringConversion.Rebridge.Mutable 836 904 +8.1% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
LazilyFilteredArrayContains 36900 33700 -8.7% 1.09x
Array2D 8112 7520 -7.3% 1.08x
RemoveWhereSwapInts 72 67 -6.9% 1.07x (?)
MapReduce 426 397 -6.8% 1.07x
MapReduceAnyCollection 426 398 -6.6% 1.07x (?)

Code size: -O

Performance: -Osize

Improvement OLD NEW DELTA RATIO
FlattenListLoop 4432 4062 -8.3% 1.09x (?)
Array2D 7216 6624 -8.2% 1.09x (?)
RandomShuffleLCG2 800 736 -8.0% 1.09x
RemoveWhereMoveInts 40 37 -7.5% 1.08x (?)
RemoveWhereSwapInts 67 62 -7.5% 1.08x (?)
MapReduce 433 404 -6.7% 1.07x

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
NSStringConversion.Rebridge.Mutable 889 974 +9.6% 0.91x (?)
 
Improvement OLD NEW DELTA RATIO
DictionaryBridgeToObjC_Access 1260 1132 -10.2% 1.11x (?)

Code size: -swiftlibs

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

@lorentey lorentey merged commit b0f30c8 into swiftlang:master Jul 14, 2019
@lorentey lorentey deleted the cutting-the-gordian-array-count branch July 14, 2019 02: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.

3 participants