Skip to content

[stdlib] Add custom .first to Array #28349

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

Closed
wants to merge 1 commit into from

Conversation

airspeedswift
Copy link
Member

A bit brute force but it avoids double bounds checks that aren't getting optimized away.

@airspeedswift
Copy link
Member Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
ArrayAppendOptionals 1340 2130 +59.0% 0.63x (?)
 
Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 10331 7739 -25.1% 1.33x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
ArrayAppendOptionals 1340 2070 +54.5% 0.65x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStubFromNSDateRef 4370 4840 +10.8% 0.90x (?)
 
Improvement OLD NEW DELTA RATIO
LazilyFilteredArrays2 116000 67100 -42.2% 1.73x
BucketSort 12679 9245 -27.1% 1.37x

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

@airspeedswift
Copy link
Member Author

Superseded by #28486

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