Skip to content

Move pre-specializations of popular types away from the stdlib #1392

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
Feb 23, 2016

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Feb 21, 2016

Pre-specializations were only used by Onone builds, but were kept inside the standard library dylyb anyways. This commit moves all the pre-specializations into a dedicated Swift module and a dynamic library, which are only used by Onone builds.

This reduces the code size of libswiftCore.dylib by 5%.

@swiftix
Copy link
Contributor Author

swiftix commented Feb 21, 2016

@swift-ci Please test

@@ -0,0 +1,6 @@
add_swift_library(swiftSwiftOnoneSupport SHARED IS_STDLIB
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, this directory should be named 'SwiftOnoneSupport'.

@swiftix
Copy link
Contributor Author

swiftix commented Feb 22, 2016

@gribozavr Thanks for the review, Dmitri! I've incorporated your suggested changes and will push-force the corrected version on my branch.

BTW, do you have any idea why OS X tests pass and Linux tests fail? Do we test PM only on Linux?

@gribozavr
Copy link
Contributor

@swiftix It looks like we run swiftpm tests on OS X (https://ci.swift.org/job/swift-PR-osx/173/console#console-section-9). Maybe that is a smaller set of tests? I don't know.

@swiftix swiftix force-pushed the wip-prespecializations-module branch from eb009fa to cdd38dd Compare February 22, 2016 01:01
@swiftix
Copy link
Contributor Author

swiftix commented Feb 22, 2016

@swift-ci Please test

@swiftix
Copy link
Contributor Author

swiftix commented Feb 22, 2016

@gribozavr Yes, indeed. We run PM tests on OS X. I wonder if may be it is related to using different linkers on OS X and Linux. Or may be auto-linking works differently?

@gribozavr
Copy link
Contributor

Autolinking definitely uses a different mechanism. On OS X, we are using a linker feature. On Linux, we emit the information into a special section, and then, when linking with swift, we first scan the contents of the sections of inputs for linker flags.

@swiftix swiftix force-pushed the wip-prespecializations-module branch from cdd38dd to 899a4a1 Compare February 22, 2016 15:54
…ary.

Pre-specializations were only used by Onone builds, but were kept inside the standard library dylyb anyways. This commit moves all the pre-specializations into a dedicated Swift module and a dynamic library, which are only used by Onone builds.

This reduces the code size of libswiftCore.dylib by 5%.
@swiftix swiftix force-pushed the wip-prespecializations-module branch from 899a4a1 to 4d4c2cd Compare February 22, 2016 15:55
@swiftix
Copy link
Contributor Author

swiftix commented Feb 22, 2016

@swift-ci Please test

@swiftix
Copy link
Contributor Author

swiftix commented Feb 22, 2016

This is currently blocked by the following issue: swiftlang/swift-corelibs-xctest@6a1e783

@swiftix
Copy link
Contributor Author

swiftix commented Feb 22, 2016

@swift-ci Please test

swiftix added a commit that referenced this pull request Feb 23, 2016
Move pre-specializations of popular types away from the stdlib to reduce the stdlib code size.
@swiftix swiftix merged commit c978092 into swiftlang:master Feb 23, 2016
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.

5 participants