Skip to content

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

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 25, 2016

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Feb 24, 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 4%-5%.

This PR fixes some problems discovered when trying to merge the PR #1392:

  • There were some issues with debug builds
    • The new library was not using -parse-stdlib
    • CMake rules for Swift files were not making sure that they always depend on SwiftOnoneSupport
  • Not all pre-specializations available when Prespecialized.swift was part of the stdlib were available in this new dedicated library for Onone.

@swiftix
Copy link
Contributor Author

swiftix commented Feb 24, 2016

@swift-ci Please test


# swiftSwiftOnoneSupport does not depend on itself,
# obviously.
if("${name}" STREQUAL "swiftSwiftOnoneSupport")
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want to do this block unconditionally, even when building non-optimized libraries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gribozavr If we do this whole block unconditionally, then we introduce a link dependency on swiftSwiftOnoneSupport even in Release builds, which results in this dylib being linked to the apps even though it is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gribozavr But the two removal operations could be performed unconditionally, I agree. Because swiftSwiftOnoneSupport and stdlib do not depend on swiftSwiftOnoneSupport under any circumstances.

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

@phausler @parkera I'm ready to merge on my side. But I still need your corresponding foundation changes to be committed, otherwise the Linux build will fail. Please see my email for details.

@phausler
Copy link
Contributor

@swiftix can you provide a pull request with the appropriate changes to the build scripts?

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

@phausler Will do.

…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 4%-5%.
@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

@phausler I provided a PR you asked for. You can review it at swiftlang/swift-corelibs-foundation#266

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

@phausler Please let me know when you are ready to merge, so that we can do it in sync to avoid any broken builds.

swiftix added a commit that referenced this pull request Feb 25, 2016
Move pre-specializations of popular types away from the stdlib.

This saves 4%-5% of code size in libswiftCore.dylib.
@swiftix swiftix merged commit 17a2106 into swiftlang:master Feb 25, 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.

3 participants