Skip to content

Reduce the code size of the standard library by about 5%-6% #10263

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 3 commits into from
Jun 15, 2017

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Jun 14, 2017

Reduce the code size of the standard library by about 5%-6% by adding annotations preventing inlining and/or generic specialization in a couple of places. These places were identified by means of the cmpcodesize utility.

• Explanation: Reduce the code size of the standard library dylib.

• Scope of Issue: Inlining and specialization of some generic functions were causing significant code increase without providing any performance improvements. This PR addresses this issue.

• Origination: N/A

• Risk: Very low. This patch is cherry-picked from the master, where these changes have been landed a week ago and have not caused any issues or performance regressions. The only effect of this PR is the reduced code size of the stdlib.

rdar://problem/32776747

swiftix added 3 commits June 14, 2017 14:09
…r to reduce the stdlib code size

This shaves off 3.2% of the stdlib’s code size.
This should reduce the code size of the stdlib by 1.5%.
…e size

Move the error reporting slow-path into a separate function, which is not inlined or specialized.
This reduced the stdlib code size by almost 1%.
@swiftix
Copy link
Contributor Author

swiftix commented Jun 14, 2017

@swift-ci please test

@swiftix
Copy link
Contributor Author

swiftix commented Jun 14, 2017

@aschwaighofer Could you please review this PR?

@aschwaighofer
Copy link
Contributor

LGTM

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 6048aa1
Test requested by - @swiftix

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 6048aa1
Test requested by - @swiftix

@DougGregor
Copy link
Member

Nice!

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please test

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please test osx

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 6048aa1
Test requested by - @swiftix

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 6048aa1
Test requested by - @swiftix

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please smoke test

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please smoke test Linux

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please test linux

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please test OS X

@swiftix
Copy link
Contributor Author

swiftix commented Jun 15, 2017

@swift-ci please smoke test OS X

@swiftix swiftix merged commit a3ab1ac into swiftlang:swift-4.0-branch Jun 15, 2017
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.

4 participants