Skip to content

[stdlib] Make _convertConstStringToUTF8PointerArgument transparent #32915

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 16, 2020

Conversation

airspeedswift
Copy link
Member

This function not being inlinable prevents optimizing it away, and it doesn't actually access any string internals.

@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift
Copy link
Member Author

@swift-ci please benchmark

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

We'll definitely want to change this implementation, but making this @_transparent doesn't prevent that. (And we can also remove the attribute if it turns out we want this to call internal things later.)

I think ideally this intrinsic would be eventually replaced by something that follows a withCString-style, closure based approach.

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListLoop 956 1385 +44.9% 0.69x (?)
DropFirstArrayLazy 13 14 +7.7% 0.93x (?)

Code size: -O

Improvement OLD NEW DELTA RATIO
CString.o 6743 6375 -5.5% 1.06x
NSStringConversion.o 12108 11762 -2.9% 1.03x
ObjectiveCNoBridgingStubs.o 8364 8136 -2.7% 1.03x
ObjectiveCBridging.o 61999 61061 -1.5% 1.02x

Performance: -Osize

Regression OLD NEW DELTA RATIO
FlattenListLoop 991 1416 +42.9% 0.70x (?)
IterateData 866 937 +8.2% 0.92x (?)
StringWalk 1520 1640 +7.9% 0.93x (?)
FlattenListFlatMap 2847 3063 +7.6% 0.93x (?)

Code size: -Osize

Improvement OLD NEW DELTA RATIO
CString.o 6433 6149 -4.4% 1.05x
NSStringConversion.o 11542 11232 -2.7% 1.03x
ObjectiveCNoBridgingStubs.o 8045 7847 -2.5% 1.03x
ObjectiveCBridging.o 58410 57408 -1.7% 1.02x

Performance: -Onone

Improvement OLD NEW DELTA RATIO
DataCountMedium 55 50 -9.1% 1.10x (?)

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 mini
  Model Identifier: Macmini8,1
  Processor Name: 6-Core Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7adafca

@airspeedswift
Copy link
Member Author

@swift-ci please test macOS platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7adafca

@airspeedswift
Copy link
Member Author

@swift-ci please test linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7adafca

@airspeedswift
Copy link
Member Author

@swift-ci please smoke test and merge

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