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

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

Merged
merged 3 commits into from Jun 15, 2017

Conversation

Projects
None yet
4 participants
@swiftix
Member

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 some commits Jun 2, 2017

[sil-generic-specializer] Do not specialize Mirror._superclassIterato…
…r to reduce the stdlib code size

This shaves off 3.2% of the stdlib’s code size.
Reduce code size of the stdlib
This should reduce the code size of the stdlib by 1.5%.
Re-factor Codable.decode functions to reduce the standard library cod…
…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

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 14, 2017

Member

@swift-ci please test

Member

swiftix commented Jun 14, 2017

@swift-ci please test

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 14, 2017

Member

@aschwaighofer Could you please review this PR?

Member

swiftix commented Jun 14, 2017

@aschwaighofer Could you please review this PR?

@aschwaighofer

This comment has been minimized.

Show comment
Hide comment
@aschwaighofer
Member

aschwaighofer commented Jun 14, 2017

LGTM

@swift-ci

This comment has been minimized.

Show comment
Hide comment
@swift-ci

swift-ci Jun 15, 2017

Contributor

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

Contributor

swift-ci commented Jun 15, 2017

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

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please test

Member

swiftix commented Jun 15, 2017

@swift-ci please test

@swift-ci

This comment has been minimized.

Show comment
Hide comment
@swift-ci

swift-ci Jun 15, 2017

Contributor

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

Contributor

swift-ci commented Jun 15, 2017

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

@DougGregor

This comment has been minimized.

Show comment
Hide comment
@DougGregor

DougGregor Jun 15, 2017

Member

Nice!

Member

DougGregor commented Jun 15, 2017

Nice!

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please test

Member

swiftix commented Jun 15, 2017

@swift-ci please test

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please test osx

Member

swiftix commented Jun 15, 2017

@swift-ci please test osx

@swift-ci

This comment has been minimized.

Show comment
Hide comment
@swift-ci

swift-ci Jun 15, 2017

Contributor

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

Contributor

swift-ci commented Jun 15, 2017

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

@swift-ci

This comment has been minimized.

Show comment
Hide comment
@swift-ci

swift-ci Jun 15, 2017

Contributor

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

Contributor

swift-ci commented Jun 15, 2017

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

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please smoke test

Member

swiftix commented Jun 15, 2017

@swift-ci please smoke test

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please smoke test Linux

Member

swiftix commented Jun 15, 2017

@swift-ci please smoke test Linux

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please test linux

Member

swiftix commented Jun 15, 2017

@swift-ci please test linux

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please test OS X

Member

swiftix commented Jun 15, 2017

@swift-ci please test OS X

@swiftix

This comment has been minimized.

Show comment
Hide comment
@swiftix

swiftix Jun 15, 2017

Member

@swift-ci please smoke test OS X

Member

swiftix commented Jun 15, 2017

@swift-ci please smoke test OS X

@swiftix swiftix merged commit a3ab1ac into apple:swift-4.0-branch Jun 15, 2017

4 checks passed

Swift Test Linux Platform 9921 tests run, 0 skipped, 0 failed.
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform 39892 tests run, 0 skipped, 0 failed.
Details
Swift Test OS X Platform (smoke test)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment